It is never possible to know if any event in human history could plausibly have been avoided. But we can speculate by looking at the causes of the war.
Perhaps the major cause of the war was Germany's aggressive attempt, under Kaiser Wilhelm II, to get its "place in the sun." That set of actions on Germany's part led to fears on the parts of France, Great Britain and Russia. Their alliance led Germany to fear being encircled. These fears made war more likely.
Given this, the best way to have avoided WWI would have either been for Germany not to be so aggressive or for the others not to have feared Germany. In both cases, it seems that better diplomacy would have been needed. The Allies would have had to convince Germany that it did not need a "place in the sun." Or Germany would have had to persuade the Allies that it did not mean them any harm. One side or the other needed to be less frightened of the other's actions.