Are you saying this because you are extrapolating from American law regarding whether a company has a 'nexus' within a given state, or perhaps thinking about taxation?
In those specific cases, what you are saying is true, but in general national-level governments do not care that foreign companies are not actually headquartered within their borders. They demand (arrogantly one might say) that all companies doing business with their citizens follow X,Y,Z rules or else they'll try to sanction the company.
Granted if a company is truly foreign then any sanction would be pretty limited in scope.
However, easy sanction is to stop credit card processors and banking agencies from dealing with a foreign company thus stopping your citizens from easily giving them money.