A story in Exodus tells of how the egyptian ruler commanded the death of all males born (a law of that time) the midwives did not listen to their gov, and knew that it was wrong to kill even though that was their orders. God noticed this action and rewarded the women for doing right in His eye and not the laws.
God given laws are not the same as man made laws.
If all the rulers of the world set laws for evil intentions, would that make it right to sin?