At first, it seems like Baba, Amir's father, is acting in an altruistic manner by allowing Hassan and his father Ali to live as his servants. Amir notes that Baba is very loving towards Hassan, and attributes that love to Baba's own giving nature. However, it turns out that Hassan is actually Baba's child, not Ali's; Ali is sterile and Baba fathered Hassan to give Ali the son he always wanted.
Hassan’s not going anywhere, he’d barked. He’s staying right here with us, where he belongs. This is his home and we’re his family.
(Hosseini, The Kite Runner, Google Books)
Amir does not find this out until years after the others have died; he realizes that the harsh love shown by Baba towards him was designed to strengthen him and make him sympathetic towards Hassan and his people, since they are all more closely related than he ever knew. He also realizes that the love Baba shows to Hassan is from a true father towards a son, although Baba is never able to truly tell Hassan how much he means to him.
They are biologically son and father. However, in terms of relation they act in a Uncle and Nephew sort of relation. Baba is well aware of Hassan being his son, however over the entire course of the story Hassan does not know that his real father is Baba.