Given the "given", you might want to try,
When people treat their dog too nicely, it thinks it's the leader of the pack and so it might attack its owners.
If you use "dogs", then you may want to reduce the co-referential ambiguity (people, dogs = they, their) by making the adverbial phrase passive, like this,
When dogs are treated too nicely, they think they're the leaders of the pack, and so they might attack their owners.
Using leaders of the packs makes it sound as if the dogs have more than one pack. Likewise, people who treat their dogs has the same plural reading.