Many races of dogs are relatively new with most of them appearing (were bred) in the last few hundred years. These variations are caused by small mutations in certain genes and this is also the problem. To keep a race pure, it has to be interbred to maintain the special set of mutations. And this makes the dogs vulnerable to collect more damaging mutations, especially when the number of animals used for breeding are too small. This is the same problem, that animal conservation projects face in zoos.
A good example for that is the Dalmatian dog. Its characteristic spotted pattern is caused by genes, that can also cause sensineural deafness. To avoid this, deaf dogs are excluded from the breeding and a backcross project was started.