We are addressing two different etiquette aspects here.
The first has to do with the hosts dress code. According to etiquette, there are four dress codes. White tie, black tie, semi formal (or informal) and casual. Each of these has different requirements as to the formality of dress. A host is allowed to dictate the formality of the event they are hosting, but is not allowed to dictate the specific forms of clothing worn by attendees, i.e. length of dress, jewelry, hairstyle, height of heels. So a host who tries to tell their guests how to specifically dress is not following etiquette and is therefore "rude".
The second has to do with what one does when one receives an invitation that dictates a specific form of dress. Since the hosts have no say in what guests wear as to the specifics of dress, it is not rude for a guest to decide that they will wear what they want as long as the formality of the event is adhered to. Now we all know that rel@tionships have a lot more involved than etiquette, so this is where deciding for yourself whether to adhere to the hosts wishes, or not, or decline the invite comes in. It is not rude or PA to wear what you wish to a hosted event as long as you conform to the formality set forth by the hosts.
*The only exception to this that I can find is if the [church, temple, mosque] has rules that shoulders, hair etc... must be covered while in the house of worship.
All "yous" general.