My friend told me that Austrians are Germans but don’t consider themselves to be Germans anymore because of WW2 and the Holocaust. But, he said the reason why the Germans didn’t find it strange that Adolf Hitler was Austrian was because at that time Austrians were considered to be a type of Germans like Bavarians. What’s the truth?
You have hit upon a real debate that actually happened during the mid-19th century, known as 'the German question'.
This was a time of rising nationalism and, with it, the rise of nation-states. In the middle of this century, especially around 1848 when Europe experienced a wave of revolutions that were in part tied to nationalism, there were serious questions being asked amongst the German states as to which of them was best equipped to lead the rest into a united Germany. Austria's inclusion in such a state was a specific point of contention as, owing to their power at the time, it would have been likely that they would have been (or would have wanted to have been) the most influential power within this state's new internal politics. The argument was broadly split between those who were pro-Austria (or pro-Grossdeutschland), and those who were not/ pro-Prussia (or pro-Kleindeutschland).
In the end, those more in favour of Prussia won out, for a number of reasons that included cultural differences, Prussia's military strength and victory in numerous conflicts (including against Austria), and Austria's entanglements in the Italian Wars of Unification. Germany was united in 1871 largely under the influence of Prussia's nobility and without the inclusion of Austria. Other than for a brief period immediately preceding and during the Second World War (the 'Anschluss', 1938-1945), Austria has not been part of a united German state ever since. In this sense, it could be argued that Austrians are not Germans.
This, though, would likely be seen as too strict a definition of 'Germany', or of a nation more generally. The answer to this question really depends on your perspective. Austrians and Germans are quite alike in many ways, including (but not limited to) geographic distribution, language, and culture. Is this enough to say that Austrians are Germans? Would all Austrians feel the same way about this? Who defines who is included in a nation, anyway?
This has been, and remains, the subject of intense scholarly debate. If you want to read more generally about nationalism and nations, some of the more important texts in the field have included:
What is a Nation? (Qu'est-ce qu'une nation?), Ernest Renan, 1882 (old, but known for such phrases as the nation being a 'daily referendum' and sort of exemplifies the social constructivist school of thought around the topic).
Imagined Communities, Benedict Anderson, 1983 (seriously: this thing is like the Bible of nationalism studies).
Nations and Nationalism since 1780, Eric Hobsbawm, 1992 (another important scholar in this field, with similar views to Anderson, albeit with a Marxist flavour).
Ethno-symbolism and Nationalism: A Cultural Approach, Anthony D. Smith, 2009 (not his most well-known work, but sums up the school of thought he pioneered, ethno-symbolism).
For something specifically about the German question, try:
Metternich and the German Question, Robert D. Billinger, 1991.
Although I will admit I am not as familiar with the literature surrounding this particular debate as I am for nationalism studies in general.
I hope that my limited knowledge has enlightened you a bit on this issue.