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.