Can you ever trust a dog around children? It depends on the dog, and it depends on the child. But it's safest to say that the answer is simply "no".
No dog should ever have access to a newborn baby unless the baby is in someone's arms (swaddled/held entirely) and/or the dog is on leash. Toddlers are completely unpredictable and can accidentally "threaten" a nervous dog simply by looking, walking or reaching. Lots of dogs are nervous. It's very, very common.
Bite risk is real, and it is usually severe in young children, with injuries to the head and face. In my behavior appointments, I explain to new parents or parents who've recently adopted a dog that it's my job to make them "paranoid" about safety. I try to compare safety practices to putting a child in a secure car seat for even the shortest drives. That includes avoiding cute photos unless the baby is in someone's arms.
As far as adopting adult dogs with unknown or murky backgrounds - it is probably not a good idea for homes with young children. Dogs would fare better in a home where they can move more freely, and where adults are less distracted.