I have heard the expression that an uncle is like the father implying that he should be treated with the same love and respect. Someone said that this is a hadith. So is there any hadith which says that an uncle is like a father? By uncle I mean father's brother.
Is this mentioned in hadith compilations?
Yes there is a sahih hadith in which this is mentioned in the context of zakat or sadaqah:
Ibn Jamil is taking revenge but for this that he was destitute and Allah made him rich. As regards Khalid, you are unjust to Khalid, for be reserved his armours and weapons for the sake of Allah, and as for 'Abbas, I shall be responsible for it and an equal amount along with it. And he again said: 'Umar, bear this in mind, the uncle of a person is like his father. (Sahih Muslim)
Further there's a narrative which can be considered a Mursal hadith from az-Zuhri mentioned in al-Birr wa as-Sillah of al-Hussayn ibn Harb البر والصلة:
حدثنا الحسين قال: أخبرنا حجاج الرصافي، عن جده، عن الزهري، قال: بلغنا أن رسول الله صلى الله عليه وسلم قال: «العم أب إذا لم يكن دونه أب، والخالة والدة إذا لم تكن دونها أم»
Al-Hussain told us, he said: Hajjaj al-Rusafi told us, on the authority of his grandfather, on the authority of az-Zuhri, he said: We were informed that the Messenger of God, may God’s prayers and peace be upon him, said: “The uncle is a father if there is no father below him, and the maternal aunt is a mother if there is no mother below her.”
How to interpret the statement?
This means that the paternal uncle (the brother of the father) is similar to the father a person one should respect and obey (in anything which is halal) especially if one has lost his own father the paternal uncle is among the last relatives from this site of the family. Note that the same applies to maternal aunt.
In his Fayd al-Qadir فيض القدير (the commentary on al-Jami' as-Saghir of imam as-Suyuti) al-Manawi explained the bold expression as follows:
5602 - (عم الرجل صنو أبيه)... أي مثله يعني أصلهما واحد فتعظيمه كتعظيمه وإيذاؤه كإيذائه وفيه حث على القيام بحق العم وتنزيله منزلة الأب في الطاعة وعدم العقوق (Source)
5602 - (A man’s uncle is the son of his father) ... i.e., similar to him, meaning they are (their origin is) the same, so venerating him is like venerating his father, and hurting him is like hurting his father. In its meaning there is (also) an urge to fulfill the right of an uncle and to lower him the status of a father in obedience and non-disobedience.
Imam an-Nawawi in his commentary on Sahih Muslim summarized (See here):
(عم الرجل صنو أبيه) أي مثل أبيه وفيه تعظيم حق العم
(A man’s uncle is like his father) i.e., like his father and in it is glorification of the uncle’s right.
Also note that similar in Arabic is not equal so there's a prioritization and certain difference.
In the book Fiqh of Arabic language فقه اللغة وسر العربية (see: لفصل الرابع والستون: في إقامة العم مقام الأب والخالة مكان الأم.) of a-Tha'alibi the author dedicated the topic of setting the (paternal) uncle similar to the father and setting the (maternal) aunt similar to the mother a headline from which I'll quote some references next.
Are such "equalizations" used elsewhere?
Here also we must say yes. But one must be aware that this also due to the Arabic language: For example if we use the plural of أب (father) أباء referring to single person or where it is understood as the fathers of each person it clearly is a reference to the father, the father's father and so on. And their are many cases like this in the qur'an and sunnah. In the following I'll quote the examples a-Tha'alibi mentioned in his book:
أم كنتم شهداء إذ حضر يعقوب الموت إذ قال لبنيه ما تعبدون من بعدي قالوا نعبد إلهك وإله آبائك إبراهيم وإسماعيل وإسحاق...
Or were you witnesses when death approached Jacob, when he said to his sons, "What will you worship after me?" They said, "We will worship your God and the God of your fathers, Abraham and Ishmael and Isaac - one God. And we are Muslims [in submission] to Him." (2:133)
Here the author commented (see here):
وإسماعيل عم يعقوب فجعله أبا.
Isma'eel actually is the (paternal) uncle of Ya'aqub but he was set equal to a father in this statement.
He also mentioned from the story of Yusuf:
ورفع أبويه على العرش
And he raised his parents upon the throne ... (12:100)
Literally this could be translated:
And he raised his two fathers (or both his fathers) upon the throne
This translation was mentioned by Dr. Ghali, however he was referring to verse 6 as the clue referring to Ibraheem and Ish'aaq. While a-Tha'alibi's comment is saying (same source as above):
يعني أباه وخالته وكانت أمه قد ماتت فجعل الخالة أما.
Meaning his father and his maternal aunt. His mother has died so HE set the aunt equal to a mother.
Yes there exists a hadith with this meaning. The Prophet ﷺ said regarding Abbas ibn Abdul Muttalib:
أن عم الرجل صنو أبيه
A man's paternal uncle is like his father