As an example, in Saudi Arabia, all women are required to wear an abaya a long black cloak that covers all, but the hands and face in public. [1] Is that a good law? I don't know. But if Google wants to do business there, e.g. some female Google employee went on business trip in Saudi Arabia, she needs to obey the law there. Of course Google can choose not to do any business in Saudi Arabia. Google can even exits Saudi Arabia as a sign of protesting this law. But if I were a Saudi Arabia resident who would suffer from lack of access to information online, I would certainly hope Google does not do this.
[1] https://en.wikipedia.org/wiki/Culture_of_Saudi_Arabia#Dress