Under the Outer Space Treaty 1967 jurisdiction belongs to the flag of the vessel1:
A State Party to the Treaty on whose registry an object launched into outer space is carried shall retain jurisdiction and control over such object, and over any personnel thereof, while in outer space or on a celestial body.
There is a seperate treaty for the ISS which states:
Canada, the European Partner States, Japan, Russia, and the United States may exercise criminal jurisdiction over personnel in or on any flight element who are their respective nationals.
In a case involving misconduct on orbit that: (a) affects the life or safety of a national of another Partner State or (b) occurs in or on or causes damage to the flight element of another Partner State, the Partner State whose national is the alleged perpetrator shall, at the request of any affected Partner State, consult with such State concerning their respective prosecutorial interests.
An affected Partner State may, following such consultation, exercise criminal jurisdiction over the alleged perpetrator provided that, within 90 days of the date of such consultation or within such other period as may be mutually agreed, the Partner State whose national is the alleged perpetrator either: (1) concurs in such exercise of criminal jurisdiction, or (2) fails to provide assurances that it will submit the case to its competent authorities for the purpose of prosecution.
Any other multi-jurisdictional vessels (such as a mission to Mars) would presumably have their own treaties. Similarly, any (semi-)permanent colonization of an extra-Earth body would no doubt be subject to a treaty given that, at present, no country is entitled to claim sovereignty is space - something that would be needed before a multi-trillion dollar investment could proceed.
Notwithstanding, extra-territorial national laws always apply to citizens of that nation.
1 https://www.businessinsider.com.au/heres-what-happens-if-you-commit-a-crime-in-outer-space-2014-1?r=US&IR=T