We could say that war makes for some strange bedfellows (not like that, get your mind out of the gutter). That is, in any emergency, a bunch of strangers might be thrown together, while old established communities are broken up (temporarily or permanently). For example, in The War of the Worlds, war separates the narrator and his wife. (Well, OK, the narrator's own stupidity separates him from his wife – but it's his stupidity about the war.) Then, after the war breaks up his nice little community with his wife, it gives him another sort of community with the artilleryman and then the curate. You could say The War of the Worlds shows us how communities are broken up by war and how they also get created.
Though, let's be honest, The War of the Worlds shows a lot of negative temporary communities caused by the war (the artilleryman, the curate) and not many positive ones (the narrator's brother and the Elphinstones). Heck, even some of the pre-war communities don't seem all that positive. For instance, remember when that guy falls into the Martian pit in Book 1, Chapter 4. Does anyone go help him? Nope, not a chance.
In The War of the Worlds, communities are formed by shared ideals, but those ideals largely disappear during wartime.
Communities in The War of the Worlds are disrupted by having too much in common; people need some differences in order to form a community.