I’ve been to Iran a couple of times. Had to wear hijab and “modest” clothing.
But Iran isn’t a particularly religious society. People attend mosque about as much as people in Australia attend church. That is, not very much.
Any government dictates norms of behaviour. What side of the road to drive on, for example. Which end of the egg to crack open in Swift’s example.
Are these things anything divine? I don’t think so. They are conveniences — usually the convenience of whichever combination of race, gender, and culture holds the power.
No secular authority can dictate what goes on in a person’s head. They can influence belief, but they cannot force it.
Having said that complying with dictates of any sort can be bothersome, dangerous, or lethal.