I once ignored a shirt and tie mandate and nothing happened besides some stern words from my manager after I told I wasn't going to comply. We worked in a basement and never saw customers, the mandate was just a power move on his part.
Similar, my boss insisted I wear trousers but I’m more comfortable in my underpants. They’re clean, and I don’t have much in the way of a bulge. Power move, too, I suspect.