The only way this would matter is if this were a talent competition, a pageant, a theatrical production or something of that nature, where costumes are custom-made, tailored, and often custom-designed at the more elite levels. Copying someone's personalized dress would be serious. Performers and competitors can spend a great deal of money and time creating their outfits. It also might matter if someone had her prom or wedding dress custom-designed and sewn.
In this case, the character Merida is a fictional character from an animated movie. Costumes and dolls and toys and candy and nearly every product imaginable are mass-produced to sell Merida, and the Frozen sisters and Cinderella and all of the Captain America/Batman/Iron Man heroes and almost every character in every movie and tv show.
You and this other mom both purchased commercially available costumes at what I presume is a party store or mass merchandiser. So there's no harm done. Walking into a store and purchasing a commercially licensed costume based on a popular and heavily advertised movie certainly does not guarantee that you'll be "the only one". That's just ridiculous. I know this little girl is only maybe 5 or 6, but if my child at that age had refused to go trick or treating in a costume I spent good money for, I'd return the costume and tell her that spoiled brat behavior won't fly for even a minute in my home. She has two choices: wear the costume with a good attitude, realizing that there will be many Merida and Elsa and princess costumes and probably 300 Batman and Superman costumes on Halloween, or not wear the costume and stay home and fume in her room.
I wouldn't tell your daughter to stand up for her choice, like this was a personal statement or a response to bullying. This is a chance to teach her how to brush off the many spoiled brats she'll encounter in this world (years from now it will be "she got the iPhone 23f and she copied me. I'm unfriending her.") If her spoiled brat friend treats her badly, I'd just matter-of-factly say something like "well, when we bought the costume we knew there would be lots of them (I imagine you had to look through several Merida costumes to find your daughter's size, right?). Merida was a really fun and brave girl, just like you! Just enjoy being Merida for the night and if someone else has a problem, that's their loss." No big deal.