What a shame.
If anyone ever comes to our house and is uncomfortable around our dog, I shut her in the utility room, and she has the most beautiful nature of any dog I've ever known. I then try and explain to the child that they should try and stroke her etc. My dog has helped several children overcome their fear of dogs.
Learning how to behave around animals is a life skill, like crossing the road.
I know I'm going off track, but those friends who separate the dog are obviously sensible and responsible. I'd use the opportunity of getting to know that dog in order for her to overcome her fear.
Your DD needs to know that most dogs are lovely. I have the opposite problem, with a DD who struggles not to think that every dog she meets wants to be her friend. I have taught her never to stroke or approach a dog without first asking the permission of the owner - you just never know.
I know one little girl whose anxiety was so extreme that she couldn't go for walks in the woods, or go to the park. IMHO, her mother fed this anxiety, saying things like "Oh, here's a dog, don't panic (in a very panicky voice!), although she was unaware of this, I think.
Through spending time with my dog, she no longer runs like a headless chicken, screaming and flapping about, which is a result.
Her mum tried to deal with it by avoiding dogs
, or picking her up and moving her out of the way, till I asked her how her daughter would cope when she's bigger, if she was walking home from school and saw a dog walking towards her. Probably by being so panicked that she'd run into the road, I suggested. She dealt with it then.
I know I'm going on (and on) but don't let your daughter's anxieties get out of hand, OP! If she's aware that animals need to be shut away when she enters a house, that is sending her a strong message that they are bad and to be feared, and that she should not be near them.