No one really knows why some people develop allergies and other people do not. It may have something to do with genetics. If your parents were allergic to dogs, you may be more prone to dog allergies or other allergies.
It may also have something to do with early exposure to dogs shortly after birth. If you are exposed to dogs early, you may be less likely to develop an allergy later in life.