You can use either the average man or an average man. Both are fine for the generic meaning.
Grammatically, both sentences are correct. Stylistically, they are distinctly un-English. Why say the height of that of an average man, which means the height of the height of an average man, when you can say the height of an average man? And then there's