I like Suz's direct but friendly example of what to say to the mom and dad, below!
I also really, really hope the tags are still on this dress because it needs to go back.
It's interesting to me here that you don't mention the girl's parents at all in this scenario. For all you know they have zero idea that their daughter bought this dress for your daughter, and they may be livid about it when they do find out. Or they may blithely say, "How nice!" and not care. But you don't know either way and it's odd to me that you never once mention approaching the parents. That would be my first instinct. Yes, they take the girls to expensive meals and on vacation (was the vacation comment something that has actually happened, or just an example of potential expenditure on your daughter?). But that does not make this dress right.
I would tell your daughter kindly that though it was very generous of Sally to give her the dress on the spur of the moment, that's exactly what it was -- the spur of the moment. And the dress has to go back. "I know that Sally seems to have a lot of money to spend, and she has paid for many other things for you. But this is different, and I hope you can see and understand that. We had a budget for your dress, and while what she did was nice, it was both beyond your budget and not appropriate because it's such a large amount and we have no idea if her parents were even aware she was spending that money." When daughter says "But this will hurt Sally's feelings," you have to counter with, "I understand that you don't want to hurt her, but this is a case of thinking before you buy, and she did not do that. She got carried away, in a nice way, but it's not appropriate to go so far beyond your budget. I have to let her parents know that the dress needs to go back. Sally is a good friend and a real, good friend understands and will not hold it against you."
Then contact the parents, and you return the dress to their house during the day ASAP. I would not necessarily have your daughter hand it to Sally; I would give it directly to the parents (or better yet, return it directly to the store yourself IF the store will credit their card without having to have the card in hand). Let them know that you really do understand it was meant kindly and generously but your daughter had a budget and had money with her that day, and can't accept such a large gift. If they are big spenders, they may never "get" what you're meaning but you do need to model some restraint for your girl.
Please do NOT forbid your daughter from seeing her friend. That is simply not right -- the other girl is not doing anything wrong other than demonstrating a bad lack of money sense and lack of impulse control that are both more on her parents than on her. But I'd start to ensure the following:
Your daughter is too busy for any shopping with this girl. No more mall trips. I wouldn't say so out loud; I would be sure they did other things that are more creative than going to a mall frequently. I would also ensure--subtly--that your daughter is building some other friendships through activities, interests, etc. Do not ever say "Join club X to make some friends." That turns teens off. Just make it about her interests. But do not cut Sally off (more on that, below).
Your daughter and this girl could do some volunteering together. I would avoid the type of volunteering that is entirely about collecting goods (items for homeless shelter, canned goods drive, etc) because I wonder if the girl would figure, "I can just go buy those needed things and donate them myself." Instead suggest that they actually donate their time and effort working somewhere--helping serve meals, helping clean up a park, helping at a "beautify the school day." Don't say out loud, "Do this so you and Sally can learn how the other half lives" or whatever; that will turn them both off and make you the enemy. Doesn't their high school require service hours? Ours does, and in your situation I would say, "You know, you need X more service hours this quarter and there's a clean up the park day. Why don't you invite Sally to do it with you and afterward I will drive you both to get coffee, MY treat?"
Make sure your family is taking Sally to restaurants at times. Not fancy. Go places you would go anyway, on your budget, your lifestye. If Sally complains, your daughter is going to pick up eventually that Sally is looking down at her. If you've taught your kid to be comfortable with who she is, she will not appreciate that. If Sally is cool with it, you will know she's fine, and the friendship will seem more two-way than it now does.
Your husband has never been a teenage girl with money in her pocket. He seems to assume that one girl buying another an expensive dress instantly means they're dating (and I have to assume that he has an issue with that). Girls straight and gay love to buy gifts for other GIRLS. The issue here is the fact Sally pays and pays for everything, not whether either or both girls are gay. Geez. He needs to know that if he forbids Sally from being your child's friend, Sally will become "forbidden fruit" and your daughter will just like her more and will feel she must defend her misunderstood friend who is being kept from her. He will make Sally even more interesting if he tells your daughter never to see her again. And I have to repeat -- Sally's done nothing wrong other than lack any realistic idea about money. That does have to be fixed by returning the dress and ramping the outings back to ones more appropriate and less expensive. But if Sally's a good friend (or girlfriend) to your daughter aside from the money issue, there's no need to ax the friendship.