It's lucky that there were innate characteristics in dogs' ancestral species, which allowed for their domestication.
Tail-wagging in juvenile wolves and foxes was selected for in adult dogs. Their acutely sensitive hearing and olfactory sense complements our eyes etc.