How do you pop a dog's leg back into its socket?

Take him to a veterinarian. Popping joints back in is not a job for amateurs. (A distant relative of mine dislocated his shoulder playing soccer. His teammates tried to pop it back in. They ruptured the artery and he lost his arm.) By letting the vet do it.