I was actually reading something about domesticated foxes a little while ago. As the foxes got more domesticated over generations the foxes got more characteristics that humans perceive as cute. My best guess is that, that is what happened to dogs. Humans tried to domesticate wolves over a period of time and they eventually got characteristics that humans found cute, because people would take a liking to cuter looking canines. Eventually, since there was such a concentration of genes that made the wolves cuter looking, they started to look more like dogs today. Humans also started breeding dogs with certain generic variations and mutations that helped them perform a certain jobs which is why there are so many different dog breeds.