If i read this correctly, then: The dress was never on the list of possible ones the girl was going to get?
She and your daughter are not wearing identical dresses to the same event? There was never any chance that they would end up in identical dresses at the same event? ALL the drama is over the idea that "If I can't have what I want, YOU can't have what I want either"?
And the MOM kept telling you over and over how hurt her child was though mom knew perfectly well that this specific dress was never, ever one mom was going to purchase?
Mom is the real drama queen and does not even have the excuse of being twelve. The fact that mom did not simply tell her princess to zip it and stop denying her supposed best friend what princess couldn't have -- that's very telling. I would seriously reconsider your own friendship with mom here; think hard--have there been other times, other signs that mom is going to side with her kid no matter what? That she considers her child always in the right and takes her word for everything as gospel? That she caves to daughter's emotions and complaints?
Mom did all those things here and none is a good sign that mom is the one in control. Think it through. If mom has a tendency to do this at other times, I don't think either of them is a pair for your or your child to be around. A girl who would tell my daughter (about the same age as yours) "You are awful and hurt me for wearing what I liked but can't have" is not a kid I really want her seeing much.
You are careful to say more than once that the two girls have this "special relationship" that's ever so close, but again--think hard about whether this is just the over-exposure of the trip talking, or if you think there is a pattern of the girl being this self-centered and the mom letting her get away with it and actually backing her up on it. That would be a red flag to me that both of them are dramatic, and that gets worse, not better, in the teen years.
As for your own actions -- you did NOTHING wrong at all and neither did your daughter. You went a long way, maybe too far, in being apologetic to both of them. This is such a tiny thing but the other mom, rather than just nipping it and telling her child to stop being so petty and babyish, played into her child's attitude. That would put me on alert, and the next time it happens would be the last time we'd be taking that kid anywhere, no matter how much I loved the kid.