Now-a-days, we don't really blink at the idea of an allegedly virtuous hero casually murdering a bunch of Nazis or Terrorists or whatever. They seem like such cartoonish evil that we don't really consider them as more than cardboard villains. But in the 1920s and 30s, when pulp magazines were happening, Nazis presumably were just a foreign political party. So, when Doc Savage or the Shadow or someone like that needed a bunch of faceless, obviously evil goons to beat on, who did authors use? I'm sure 'savages' was a common one, but were there others?
Anarchists were feared and despised around the turn of the century, especially by the Establishment. After the anarchist assassination of President William McKinley, there was the world's first anti-terrorism conference in Rome: http://en.m.wikipedia.org/wiki/International_Conference_of_Rome_for_the_Social_Defense_Against_Anarchists
This speech by Theodore Roosevelt about William McKinley's murder is very reminiscent of those by modern leaders against modern terrorism: http://hnn.us/article/274
Communists were probably more hated than anarchists by the time of the 20s, as a result of the Bolshevik Revolution and the attempted revolution in Germany. I don't know as much about that, so I don't feel qualified to write about it, especially as I'm on my iPad at the moment.
I hope someone can provide you with a more in-depth answer. The book Blood and Rage provides a history of terrorism, including anarchist terrorism.