Was learning about imperialism in my modern Euro class and was wondering if part of the reason why so many countries decided to participate in the war was because they had the ability to declare war with the intention of taking more land for themselves.
As a followup to u/MrFeix's great overview of your interesting question, I shall provide some explanations regarding the two key "major empire powers" (Great Britain, and Germany) in relation to imperialism and their motivations for joining the Great War. As the previous comment has already pointed out however, you should take note that the degree to which a historian believes imperialism prompted these powers to get involved in World War 1 depends on the degree to which the historian is a member of certain historiographical schools.
Beginning then with Great Britain, this is perhaps the country most commonly associated with the notion of imperialism before, during, and after the Great War. That association is of course, entirely logical given that the British Empire reached it's height as a result of the German colonies which it gained control of after the Versailles Treaty. Of course, David Llyod George (the British Prime Minister at the outbreak of war) was well aware of this fact and he wished, if anything, to maintain the hegemony of the Empire in all corners of the globe. This of course, was nothing new to the European continent or British public & government. As Michael Howard indicates in his short but incredibly well-written introduction to the First World War:
The Royal Navy's 'command of the seas' both held the Empire together and ensured that the British people were fed. Loss of naval supremacy was a nightmare that dogged successive British governments and dominated their relations with other powers.^([1])
Of course, do not mistake Llyod George's concerns about the integrity of the Empire as a desire to expand it, you likely have already read about Britain's initial reluctance to join the war, even if France and Russia promised it the spoils of German territories in Africa and the Pacific. Even whilst Austria-Hungary and Serbia were marching off to conflict, the PM remained steadfast in his belief that Britain and her colonies would not join in the war. Here's an extract from a letter personally written to King George V from the PM, dated about three weeks after the assassination of Archduke Franz Ferdinand (June 28th, 1914 for reference):
"[H]appily there seems no reason why we should be anything other than a spectator"^([2])
Lest we of course fall for the trap that the perspectives of the government equate to the perspectives of their citizens, here's an extract from a popular article from the Manchester Guardian which attracted widespread support for British neutrality, dated on the 29th of August 1914 (just a day and a month after the Austrian declaration of war on Serbia):
"Not only are we neutral now, but we could, and ought to remain neutral throughout the whole course of the war... We wish Serbia no ill; we are anxious for the peace of Europe. But Englishmen are not the guardians of Serbia well being, or even of the peace of Europe. Their first duty is to England and to the peace of England... We care as little for Belgrade as Belgrade does for Manchester."^([3])
So on the whole then, whilst Britain seemed to be the nation where imperialism might have been the most appealing motivation for war, their actual concern was with protecting that which they already had: as later German manuevers against France and Belgium not only threatened their naval dominance, but also (should either of the two give their colonies to the House of Hohenzollern (of which Kaiser Wilhelm II was a prominent member), it would spell disaster for British interests in Africa and Asia.
Speaking of the German Empire, we shall turn to them next as the other side of the spectrum. The Second German Empire had perhaps the most blatantly imperialist foreign policy of all the great powers, as being a newcomer to the European world stage, many of its citizens and aristocracy believed that obtaining colonies overseas would be a major stepping stone to accelerating German prestige worldwide. This came to a head during the reign of Kaiser Wilhelm II, whose cousins (British King George V and Russian Tsar Nicholas II) also possessed large empires of their own and were thus major world players with plenty of foreign power. Foreign Secretary Bernhard von Bulow coined the infamous phrase "Our place in the Sun" during a Reichstag (German parliament) debate on the 6th of December 1897:
Mit einem Worte: wir wollen niemand in den Schatten stellen, aber wir verlangen auch unseren Platz an der Sonne. (in one word: We wish to throw no one into the shade, but we also demand our own place in the sun.)^([4])
With this clearly expansionist policy dominating the parliament and citizenry, Kaiser Wilhelm II set about expanding German influence and indeed raising the standard of Empire beyond Europe. Germany had already acquired significant swathes of East Africa (mainly due to the failed mediation attempt of the Congress of Berlin, which resulted in the "Scramble for Africa"). By 1912, the Germans had attempted to wage (and lost) an arms war in ship-building to enable their High Seas Fleet to take on and defeat the British Navy.
Of course, in the beginning of the First World War, the German Empire officially declared war on Serbia, France, and Russia in support of it's Austro-Hungarian ally. You have most likely (or will eventually) encounter the infamous "blank cheque" that Wilhelm issued in support of his Austrian counterpart Emperor Franz Joseph, and it is rather obvious that the terms of the Central Alliance bound Germany to protecting and supporting Austria-Hungary when Russia and France threatened the latter over their Serbian affairs.
Imperialism was certainly not an obvious or indeed well-known German motivator in mobilising their troops for war, but it is perhaps not too far off to assume that Kaiser Wilhelm II and members of the Prussian aristocracy were interested in gaining some colonies from the theoretical surrender of France and Belgium (because of course, German expansion had been challenged and even halted by Anglo-French resistance, see the "First Moroccan Crisis" for an example of this.
So. there we have it, a more in-depth (but by no means complete) investigation/exploration of how Great Britain and Germany viewed Imperialism as a motivating factor in World War 1. The bottom line is that whilst no country publicly or officially proclaimed war as a way to gain colonies, at some level and to varying degrees imperial sentiments were present as "side-benefits" of a theoretical victory.