During the Middle Ages people who kept pets were accused of witchcraft. And most of the time these were women social outcasts to whom their pets were the only companions.
The real value of the dog was not realised for thousands of years.
But research into dogs is expanding. And we are learning more as each research sees the light of day. Swedish scientists for instance have shown that the human-dog bond is determined by a hormone which also is the main factor for bonding mothers to their babies.
Even little more than 100 years ago people had a totally utilitarian attitude towards dogs. They were used entirely for hunting and guarding and any suggestion to have them as pets was frowned upon.