Is this question about SH3 or SH4?:hmm:
SH3 I can answer for you.
If you are playing at 100% then you must return to port, although as Mel has said you can be 20-30km and still 'dock at base' without having to actually dock your boat in the pen. This is hardcoded. The only way around this is 'strength of will', just forget that you can do it and place your boat lovingly back in her moorings.