Grain stores and mice.
Yup. Dogs for hunting, guard dogs and eventually fighting, all of which predated agriculture. As pack animals with strong in-group attachments and an innate sense of hierarchies, dogs were also much more inclined to join human packs, defer to the alpha male, and otherwise want to become best friends.