The US has the ability to assert jurisdiction over its citizens wherever they are in the world.
See Blackmer v. United States, 284 US 421 (1932).
The US does this in regards to prostitution involving minors, for example (as well as buying things from Cuba - ie, as an American you can be prosecuted for buying a Cuban cigar in England, even though it’s perfectly legal there).
There is also the ability for a country to enforce laws extraterritorally when the acts impact the nation in question.
“it is settled… that any state may impose liabilities, even upon persons not within its allegiance, for conduct outside its borders which the state reprehends; and these other states will ordinarily recognize.”
United States v. Aluminum Co. of America, 148 F. Supp. 416 (2d Cir. 1945)
A pretty good statement came from Justice Gray in 1895:
"No law has any effect, of its own force, beyond the limits of the sovereignty from which its authority is derived. The extent to which the law of one nation, as put force within its territory… shall be allowed to operate within the dominion of another nation, depends on what our greatest jurists have been content to call ‘the commity of nations.’…
‘Commity,’ in the legal sense, is neither a matter of absolute obligation, on the one hand, nor of mere courtesy and goodwill, upon the other. But it is the recognition which one nation allows within its territory to the legislative, executive, or judicial acts of anothe rnation, having due regard both to international duty and convenience, and to the rights of its own citizens or of other persons who are under the protection of its laws."
Hilton v. Guyot, 159 US 113 (1895).