The primary way that a dog tends to develop scabies is through contact with the mites directly. This can happen in any number of different ways. First, the mites may exist outside and in nature.
Scabies mites can also be passed indoors as well. They can live in carpet, and eggs can be left in carpeting as well. Thus, if your dog lies down on carpet that has the mites or the mite eggs, he may ultimately become infected by the scabies mites.
Finally, scabies are most commonly transmitted through physical contact. Multiple pets and one of them develops scabies. Any sort of close physical contact between pets can give the scabies mites the opportunity to spread from one animal to another.
Human beings can even be a vector for scabies mites as well, although the mites will not cause humans any damage.