Firstly you assume evolution would get rid of the tail, it wouldnt necessarily. Flightless birds have wings for example. Secondly dogs were created from selective breeding not natural selection.
First point is very vague so either of us could be correct, although if the tail didn’t provide some advantage it would more than likely have gotten bred out by the Canis, why carry around that extra weight which needs food to sustain if it gives you no advantage over the dog with the shorter/smaller tail.
Secondly dogs weren’t created by selective breeding, they are the result. Which is something completely different as we took wolves with a predisposition to people and they allowed themselves to be domesticated. If they didn’t have this predisposition we wouldn’t have managed to do this as happened with jackals, coyotes and wild foxes in Africa.