"History teacher" is the more natural way to say it. "Teacher of history" is perfectly correct, perfectly clear, and is not awkward.
I would be more likely to "teacher of" in these cases:
a) When the subject is not a standard school subject;
"She's a history teacher," but ...
"She's a teacher of paleontology"
"She's a teacher of forensic science"
b) When the name of the subject is a long phrase, or when begins with the word "the:"
"She's a teacher of the history of science"
"She's a teacher of applied science, engineering, and technology"
c) When "X teacher" form is ambiguous because X contains an adjective that could apply to the teacher herself:
"She's a teacher of Chinese history," not "she's a Chinese history teacher."
If I just wanted to explain what she does, I might say "She teaches X" rather than "She's a teacher of X". "She's a teacher of X" suggests not only that she teaches X, but that her formal job title at the school is "Teacher of X."