It's complicated.
WW1 happened due to the crazy web of treaties between nations. It's not unlike nuclear holocaust and MAD doctrine. There could have been other triggers for WW1, but that's not really a guarantee.
That is to say, definitely possible and maybe even likely but not inevitable.
Several leaders were itching for war, to build empires. Emprice building was normal to them as was going to war to achieve it. They opinions we hold today on war (largely from reflecting on the world wars) are not the opinions they had about war.
They gave commands to prepare for war and just needed the excuse to say go. I think the not-war outcome was very unlikely.
There's an argument to be made that WWI started because Wilhelm II was an incompetent statesman who disassembled his country's relationship with friendly states, and turned them into enemies.