Suppose, for example, I have leased a rare car from you. The lease has expired and I have refused to return the car. You have sued me for the return of the car. You have won, and the court has ordered me to turn over the car.
The court can force me to comply, even if I'm keeping the car in a garage I rent across the border in Mexico.
Does that raise issues of extraterritorial jurisdiction? Will Mexico be upset with the court? Will the court have to work with Mexican authorities to enforce its order?
The answer to all three of those questions is no.
The key is that the court is not ordering anything to happen in Mexico. It is just ordering me to produce the car.
Sure, I may have to act in Mexico to do this, by sending someone to go get it, or calling up the garage there and paying them to ship the car back, but those are ordinary acts that I am allowed to do in Mexico at will. As far as Mexico is concerned all that is happening is that someone (me) who has legally stored a car in a garage there is legally retrieving that car. They don't care WHY I'm retrieving the car.
Now if the court was not ordering me to produce the car, but instead was authorizing a sheriff to go seize the car from the garage, that would be an attempt at a US court at exercising extraterritorial jurisdiction, and Mexico would quite strongly object. The sheriff would have to go through the Mexican judicial system and get a Mexican order to seize the car.
The above example used a civil case, but the principles apply in general. I used the US and Mexico, but that's how it is between pretty much any pair of countries.
If it did NOT work this way, it would be a complete disaster for consumer protection regulation (and most other regulation). Any company that wanted to keep their records secret from regulators could simply keep those records in another country.
Nowadays, in the age of paperless, this could even be made automatic. Keep your internal mail servers and file servers in another country that does not have good relations with your home country and most of your internal records are now out of reach of regulators.