The domestication of dogs was something that was mutually beneficial at the time. The use of leashes on a walk is for the sake of safety, not because the dog wants to escape.
If you're talking about abused dogs being chained up and not taken care of, you're right. That is unethical.