Well, they can't and they don't. They have to follow the local laws.
Facebook, for example, doesn't operate in China because Facebook made the deliberate decision that they don't want to follow the same laws Chinese companies have to follow. Their comment was this: “We need to figure out a solution that is in line with our principles and what we want to do, and in line with the laws there, or else it’s not going to happen. Right now, there isn’t an intersection.”