One important difference is that "wear" is transitive whereas "dress" is intransitive (in the relevant senses). Thus "You have to wear formal attire" is correct but "You have to dress formal attire" is incorrect. Correct examples with "dress" are "You have to dress in formal attire" or "You have to dress formally".
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.