The shortest answer to this question would be that historians do not generally regard events as inevitable. They rather tend to emphasize that events like World War I are contingent on human actions and decisions. In short, they are the product of human agency. However, in the years leading to World War I, a series of human actions and decisions created a situation in which avoiding conflict was very difficult.
The causes of the war are far too complex to discuss in detail here, but it seems clear that the involvement of Austria-Hungary and Russia in the Balkans, which everyone recognized as an extremely volatile region. Ultimately, the decision of the leadership in both nations that their strategic influence in the region was worth fighting over helped to plunge the entire continent into war. Of course, it also took the actions of Serbian nationalists to spark the conflict by assassinating the Austrian archduke, another example of human agency in beginning the conflict.
An argument that the war was, in fact, inevitable, would almost certainly be based on the alliance systems which created a trap into which virtually all the powers of Europe were drawn. It could be argued, however, that German leaders unnecessarily encouraged Austria to take a hard line with Serbia in the wake of the crisis (indeed, this argument was part of the rationale for Germany's war guilt after the conflict.) However, given the nature of geopolitics in the early twentieth century, most of the belligerents acted in accord with war protocols that had been drawn up long before. Ultimately, while the war was perhaps not inevitable, a host of factors made it extremely likely in retrospect.