There is an argument of a specific gene (e.g. WBSCR17) in dogs responsible for friendliness. One study identified three particular genes, which in multiple variants or structures, or even missing, would contribute to how friendly the dog was. This does make complete sense in terms of domestication and selective breeding.