Laws apply to actions in the country, they’re not based on citizenship.
If you go to Amsterdam and sleep with a hooker, you didn’t break a law by doing that: despite prostitution (specifically purchasing sex) being illegal in many western countries.
Laws apply to whatever they say they apply to. Limiting their scope to actions in the country, or at least giving precedence to similar foreign laws, is at least as much about the practicalities of enforcement as a matter of principle.
For example, Finland claims jurisdiction over crimes where the action itself or its relevant consequences happen in Finland or the victim is a Finnish citizen, permanent resident, or legal entity. Then there are plenty of rules and exceptions detailing what those principles mean in practice.
That’s not always true, and increasingly less so, particularly the Australians and the crime of child sex tourism. I am sure it’ll be expanded to hate crimes and disturbing the peace laws as well and from there used as a political cudgel to suppress opposition to government policies. At least for now you have to be a citizen of the country but the UK has stated an intention to extradite US citizens for online hate crimes.
Manuel Noriega and “el Chapo” Guzman were both convicted of crimes they committed outside the US but that caused other people to commit crimes inside the US.
Traveling to countries for child sex abuse is illegal and severely punished, although it appears that the law is about the traveling with intent, and not (officially) about the actions that take place overseas: https://www.justice.gov/criminal/criminal-ceos/extraterritor... .
Commonwealth countries have extraterritorial jurisdiction. I don't know that it's ever been enforced for something so relatively petty as intoxication or prostitution, but it is nevertheless the law. (Obligatory IANAL though.)
Interestingly if you go to Canada and legally smoke weed then try to go to the US a month later, you can get denied because you did something that is perfectly legal in Canada, but not the US
Normally its considered legal to sell but not legal to buy.
Prostitution is primarily conducted by women, and this is a way for them to still seek protection and healthcare while still technically criminalising the practice.
I don't think UK law governs foreign companies' overseas operations based on the nationality of the customer though, no.