Generally, Muslims are required to obey the "law of the land".
Muslims are generally obliged to abide by the laws of the land and the country they live in... -- DarulIftaa.com
However, some countries enact extraterritorial jurisdiction, whereby offences are punishable in country X despite the offence taking place in country Y (and may even be legal in country Y).
Question: Does obeying the "law of the land" extend to extraterritorial jurisdiction?
To give an example of where this might arise, in Australia, the Criminal Code includes such laws:
272.8 Sexual intercourse with child outside Australia
A person commits an offence if: (a) the person engages in sexual intercourse with another person (the child); and (b) the child is under 16; and (c) the sexual intercourse is engaged in outside Australia.
Penalty: Imprisonment for 20 years.
It is possible that a Muslim Australian citizen is Islamically married to someone considered a child in Australia, and currently in a country which legally recognizes the marriage. In this setting, it may be legal for that person to have sex with their spouse in a particular country, but is nevertheless punishable under Australian law.