Your company gives you a dress code to follow at work. You don't like the restrictions, so you break the code and wear whatever you want. Predictably, they fire you. Is this a wrongful termination?
Some argue that dress codes discriminate against them, and this is a very real concern. After all, discrimination is illegal in the workplace.
That's still true for dress codes. While they are not illegal in general, it is important that companies are careful when restricting which things women and men can wear. They also cannot use the dress code to target specific groups of people such as those of certain races or religions.
The dress code also has to give the same guidelines to all workers. It doesn't matter what they look like or how old they are. If your company has a dress code, it has to be fair to you and everyone else.
So, your situation probably comes down to the reason you broke the dress code. Did you simply feel like wearing clothes that you prefer rather than the professional clothing your boss asked you to wear? They were probably within their rights to fire you. Did you want to wear something that other employees were allowed to wear, but you were denied based on gender, age, race, ethnicity or something else along those lines? If so, that probably violated your rights and it may have been a wrongful termination.
These cases can be complex, so be sure you understand all of the legal options you have. An experienced attorney can provide guidance and information.