I might say: Sometimes you have to adapt to the laws of wherever you are living. But this is also a little too formal. Better to say: Sometimes you have to adapt to the local laws.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.