Some dogs are hypoallergenic while other dogs are not hypoallergenic so yes it's possible to be non allergic to some breeds of dogs while being allergic to other breeds of dogs that shed their fur more.
A person isn't really allergic to the dog itself but instead the person is allergic to the fur on the dog when it becomes airborne.
The fur being in the air and the person breathing in the fur is what causes the allergic reaction to the dogs hair.