The dog refers to the son. The term 犬子 originally meant "puppy":
So calling one's son 犬子, would have been in essence referring to a child as "my little pup". That was not originally a self-deprecation. Instead, it was a childhood nickname for a famous poet, Ssu-ma Hsiang-ju:
This "puppy" went on to become a literary icon of Han poetry. As his fame grew, people began imitating him, and started calling their own children "puppy" after Ssu-ma's childhood name. As that practice became more widespread, eventually 犬子 became a standard deprecation for sons.
In summary, the answer is that the dog in 犬子 refers to the son. Of course, you could also say that calling your children a puppy always implied that you, as their parent, was a dog.