Here's some interesting information on the subject.
http://www.nebraskahistory.org/publish/publicat/timeline/pershing-for-pres-1920.htm
IOTL Pershing apparently didn't really try hard enough to win the primary.
And he was probably in the wrong state. Nebraska was in the isolationist heartland where feelings about the war were at best mixed, and a prominent anti-war Senator like George Norris had been re-elected without any trouble. Association with the war probably did as much harm as good.
I don't doubt that Pershing would have won in November. It was the sort of year when the Republicans could have lost only by nominating Benedict Arnold - and might still have had a chance even with him against anyone associated with the Wilson Administration [1]. But I suspect it would have been around 57-43 or thereabouts, rather than the massacre that Harding achieved.
Strange as it may seem in hindsight, Harding was the ideal candidate at the time, able to win the votes of supporters and opponents of the war alike, and of course of anybody who just didn't like Wilson. It was his bad luck to live a couple of years too long. Had he served three months rather than three years, there would be Warren G Harding memorial schools and bridges all over America.
[1] Journalist Charles Willis Thompson expressed the view that the GOP could have won without nominating any candidate at all. The people were so anti-Wilson that they would have voted for Republican Electors and let them choose any POTUS and VP that they liked.