Only Son is the dog that Mr. Doofenshmirtz won in a game of "Poke the Goozim with a Stick". As the dog grew, it became an award-winning show dog.
Before the lawn gnomes of Heinz Doofenshmirtz's family being taken away, Mr. Doofenshmirtz won a spitzenhound in a game of "Poke the Goozim with a Stick". His father named the dog "Only Son" because the dog was like the son he never had, even though Heinz had already been born.
Only Son became an award-winning show dog that brought his father fame and fortune. This should have allowed the Doofenshmirtz family to prevent the lawn gnome from being repossessed or to repurchase it, but it did not. Either the family became poor again, or Heinz's father hid the money and prizes from their creditors. The look exchanged between Heinz's father and Only Son as they won yet another competition (see the third picture below), coupled with his constant admonishments that Heinz does not move while Heinz was being the lawn gnome, seems to indicate that he deliberately placed Heinz in that situation. ("Got Game?")
This mistreatment as a child resulted in Heinz Doofenshmirtz having a fragile self-esteem, and caused him to seek revenge as an adult. His first act of revenge for the mistreatment was to steal all the lawn gnomes in the Tri-State Area. ("Lawn Gnome Beach Party of Terror")
The second was trying to win the Danville Dog Show by firing a Misbehavinator at the competition ("Got Game?").
The reason for naming the dog "Only Son" indicates that these events occurred before Roger became part of the family, since Roger is the more successful of the two brothers and was his mother's favorite. But it is still possible that Heinz's father didn't favor Roger like his wife.