It would depends (for dogs) on how well trained the dog was
For cats, it would be dependent on the temprament of the cat
For example: my older girl cat Tigger, adores literally everyone and I mean everyone - she would even get all lovey if Hitler walked in - no exaggeration
Willow? She ended up in rescue cause her previous family had a baby, and Willow's reaction was so concerning that they felt they had no choice but to give her and her sister into rescue. Then her and her sister got split up cause her sister became afraid of her.
I have seen Willow's reaction to children playing outside and I truly think she would hurt children if they came over to her (she would consider it to be self defence, she just does not trust children and I think she's afraid of them)
My Tigger, I would have around children. The worst she would do to a child is shed fur all over them and give them lots of nose kisses
Willow, like I said, she is not good around children, so for safety reasons I would never even try to have a child around her.