California science exhibit explains the dog-human friendship

Did people domesticate dogs or was it the other way around? And why do these two species seem to think so much alike, act so much alike and get along so well?