What was their temperament before? Also, were other animals given a trial as well?
Give this a shot over at /r/AskAnthropology. The domestication of dogs occurred in prehistory, >10,000 years ago. I'm fuzzy on the details, but another anthropologist should be able to help you out.
Here's the AskHistorians previously answered questions on the topic of pets. A specific question and answer. I still think you will find a better answer from the anthropologists (here's an example).