Babies can sometimes be born with allergies to dogs as well as many other allergies.
Although most babies are fine around dogs and then later in life if they've never been around dogs at all or much then they become allergic to dogs.
It has been shown in studies that if a baby is exposed to dogs and even as a toddler or child the person is less likely to develop allergies to dogs.
But sometimes people may always be allergic to dogs even when exposed to them.