Friendship between these two pairs of friends is not just impacted by social class, but also by ethnicity. In both cases, Baba and Amir are the dominant friends, and it is clear throughout the novel that this impacts their friendship with Ali and Hassan respectively. Even though Hassan and Amir fed from the same breast, which meant, according to Ali, that they are brothers, Amir is definitely the dominant one. In the same way, in the friendship between Baba and Ali, the following quote demonstrates that this friendship was not equal:
Ali and Baba grew up together as childhood playmates – at least until polio crippled Ali's leg – just like Hassan and I grew up a generation later. Baba was always telling us about the mischief he and Ali used to cause, and Ali would shake his head and say, "But, Agha sahib, tell them who was the architect of the mischief and who the poor laborer?" Baba would laugh and throw his arm around Ali.
But in none of his stories did Baba ever refer to Ali as his friend.
The paralleled relationships between Baba and Ali, and then Hassan and Amir, demonstrate that friendship between members of different social classes and races is not an equal thing. This parallel is heightened by the fact that Amir and Baba both betray their respective friends, indicating rather disturbingly that friendship is something that the more powerful person can dispense with to suit their own needs. Note what Amir later writes after he discovers the truth of Hassan's identity, and how Baba had betrayed Ali:
Baba and I were more alike than I'd ever known. We had both betrayed the people who would have given their lives for us.
Amir at least is able to right this wrong and sacrifice himself on behalf of Hassan in order to try and save Hassan's son, but the text does prove that it is very difficult for there to be true equality in friendship when there is such a difference in social class and ethnicity as there is between these friends.