Dog's are pre-programmed
Dogs have more or less the same programming as their wild cousin, the wolf. In some important ways dogs are different than wolfs which make them more amenable to life with humans. Here are some of the key points.
1) Socialization: Because they were designed to live in groups, dogs are highly attuned to the moods of their pack mates - in this case, you and your family. That's why it is ideal for puppies to join their new families during the seventh or eighth weeks of life. This is the period in which they are most susceptible to imprinting.
2) Dominance: Dog packs are structured around a well-established pecking order, from the leader, or alpha, on down. To enjoy the maximum benefits you must establish yourself as the dog's alpha.
3) Hunting: This key aspect of wolf behaviour has been altered in many important ways. In herding breeds, the urge to actually kill game has been suppressed, while the drive to stalk it has been accentuated. Many dog behaviours (nipping at heals, chasing tossed objects) are related to hunting.
4) Territoriality: Dogs are programmed to stalk out and defend territory. In most cases this will be your house and often the yard. Canines who might be quite mild if they met a stranger on neutral territory can be highly aggressive if they encounter the same person or animal on their home terrain.
5) Territorial Marking: Dogs, like wolves, mark the limits of their domain with urine and feces. This behaviour greatly eases the process of housebreaking. Since dogs will repeatedly mark the same spots, pick a location in the yard where you want your pet to expel waste. After the dog has used the spot a few times. It will update its internal preferences and remember the spot forever.