I wouldn't say it's peer pressure. Your DD just wants to be like her friend. Honestly, this is not a battle I would choose to have. They're just clothes. Put her in a casual dress with some leggings or shorts underneath. The phase will pass quickly, I guarantee it.
Edited to add after seeing your TWO follow ups -
I'm sorry, but 4 year olds have NO concept of peer pressure. Sounds like you just want someone to blame for your DD's stubbornness. Peer pressure is a peer pressuring another peer into doing something they don't want to do. Last time I checked, 4 year olds weren't threatening other kids their age with indefinite social outcast status if they didn't follow their lead. Dramatic much?
And why in the hell are you even negotiating with her on the dance class attire? Either she puts the tights on, or she doesn't go. End of story, no arguing. If she wants to whine & cry, then she can do so in her room, with the door shut, while she misses class. You move on with your day, you don't pointlessly argue with a 4 year old over something that is non-negotiable.
As far as her self esteem, I think you're doing far more damage by not letting her express herself, and having a little control over something so harmless, then could ever done by letting her think she was "pretty". But wait, now your little girl can't even think she's pretty? Isn't thinking you're pretty a good thing, and indicative of a good self esteem? Haven't you ever gotten a haircut, a new bra, a new outfit, and thought "Damn, I look good!"? I tell ya, you really are a big ball of contradiction. Those pesky clothes & their killing of little girls' self esteem all across the world, how dare they!
As far as taking the dresses away. I think it's mean. And she's still going to want the dresses, now more than ever, and you are still going to be fighting about dresses... DRESSES!! Why?!
I'm just curious, did you come here for advice? Or just to be vindicated? Or just to fight & negate everything the posters have said to you? Because it doesn't really seem like what you are doing is working, and you got lots of varied ideas & advice from the moms here. If you want to continue to let something like a dress be the cause of the stress & negativity in your household and lives, then so be it, because it sure seems like you don't want to hear anything constructive anyone has to tell you unless it's line with your opinion on the matter. Have fun, and good luck with that. When your DD is older & over this phase, you are going to wonder why in the hell you ever made such a big deal over a freakin' dress.
Do you battle her on everything? If so, I feel sorry for her, and for your household. You're going to one tired & miserable person if you make everything a fight.
Good luck, I truly mean that. I hope you find something that works for you.