She should go to A's because A asked her first, and explain to B what she's doing. BUT when she does the explaining to B - throw in a sweetener (can B come to yours next weekend?) so B is in no doubt as to whether your DD still likes her.
Not sure why she panicked tbh ~ why would saying 'I've already agreed to sleep over at A's tonight' cause any problems? If Friend B were the jealous type, it could be pointed out that she did exactly the same as Friend A, in inviting your dd, but not the other girl. Your dd wasn't choosing one over the other, she just accepted the invitation she received first.
Go nowhere and tell them that you have grounded her?
She can't ditch A to go to Bs - that's not fair. you don't do that. If you've said ok to something, even provisionally, then you don't turn that into a no because you've had another offer. It's rude.
She can say sorry, I had already accepted an invitation to A for that night. That would have been best. Is it really too late to say that now? Maybe she'd forgotten that it was tonight, but you've reminded her?
Any advice on how to help DD out of this wud be welcome! DD has 2 friends, A and B. They see each other as a three in school, but A and B don't socialise together out of school, and there's sometimes a bit of tension, they basically get on well enough for school, but not that well. DD had text conversation with A yesterday, A asked DD for a sleepover tonight .DD said that wd be good - a probable Yes, and confirm details later. Yesterday evening, DD met up with B, they went out together, and at the end of the evening, B asked DD if she'd like to come for a sleepover tonight. DD panicked and said I'll check with my mum. DD doesn't want to hurt A or B's feelings, neither A nor B know that DD has been invited by both. A would be hurt to be ditched for B, especially as she asked first, but B would be hurt later if she finds out that DD went to A's and DD hadn't said. What should DD do?!