One, he didn't volunteer to serve, he was asked in early 1939 whether he would be willing if his services were required, but wasn't tapped for the job in the end.
Two, given that the views on stomping out evil are in the Lord of the Rings (not in the Hobbit, which is concerned with recovering treasure from a dragon), published in 1954-55, it is difficult to imagine how it influenced something that happened 15 years earlier. Or the actual Nazis themselves, who had already been stomped out a decade before the novel came out.
Three, while people can freely find whatever ideas they want in the Lord of the Rings, Tolkien's own ideas on Nazism are not a secret. We have letters where he says what he has to say on the topic. Words like "Ruddy little ignoramus" (applied to Adolf) and calling the Jews a gifted people that he regret none of his ancestors came from (in a response to German publishers asking for proof of Aryanness) and "...the time is not far distant when a german name will no longer be a source of pride" (in the same response, about all the "Aryan" nonsense germans were getting up to) don't leave much room for doubt about how Tolkien himself felt on the topic.
Fourth, the scouring of the shire is not communistic in any particular. It's the rural-agrarian world of the Shire (which Tolkien loved) revolting against industrialization and its destruction of the countryside (which Tolkien hated). There's literally nothing except a brief reference to the bandits claiming to "redistribute" but not actually doing it to imply they represent communism in any way. And that one implication is weak; governments of all stripes (and capitalist industry, which insist on the importance of maximizing resources available to entrepreneurs so they can invest it most efficiently which is the best way of redistributing) all do that in one form or another.