Not true. Lots of countries have extraterritorial legislation. For example the UK authorities can prosecute for sexual offences committed overseas against children under 16 by British citizens or residents. Several countries (eg Belgium and Spain) have laws which allow them to prosecute "crimes against humanity" in whatever country they occur. Thus Spain once tried to extradite General Pinochet from the UK to face trial for actions he committed entirely within Argentina.
But you do of course have to be within the grasp of the prosecuting authorities for them to enforce the outcome of any prosecution.
I think there's a world market for about five computers. -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943