For many years, Google solved this by saying the laws of country X only applied in the country specific domain of Google.
They now seem to have backtracked on that and are using either the country the request came from or the country the account was set up from (both using IP geolocation)