Although the idea of Volksgemeinschaft became much more prominent under the Nazis, it did originate in WWI.

More importantly, we have to remember that an idea can exist long before a term is coined and used to refer to that idea. As an example from the US, the term "Manifest Destiny" was not coined until 1845. Even so, it is clear that Americans believed in this long before the term was coined. The same goes for Germany. There was clearly a strong sense of nationalism in existence even before the term came to be used.

In terms of the origin of the German "national community," modern nationalism in Germany is said to have begun in the time of Napoleon. This idea had been percolating among the romantics who felt that German people had a unique history that gave them a superior culture. When Napoleon came on to the scene, the nationalism became less cultural and more military.

German nationalists saw that Napoleon had made France strong by appealing to patriotism and nationalism. They wanted to do the same in Germany. They also felt that only a people who were truly united could stand up to the might of the French. For these reasons, German intellectuals and leaders started to push the idea of a German national community that could resist France and eventually lead to a unified Germany.