Currently, there are people who have some expertise in rescuing trapped miners. What of people whose specialty is subterranean warfare? We see an inking of it in Starship Troopers, where the Bug "Brains" had to be hunted underground. The other bugs were ferocious defenders. A computer game from the 1990s called "Descent" involved a special vehicle to go underground and clear hostile elements from a mining complex. Space- Above and Beyond had an episode that was based on combat in a subterranean Chig or AI complex. Vietnam had its "tunnel rats" who went in to Vietcong tunnels to flush them out. Siege Warfare often devolved into a game of mine sand countermines. culminating in underground tunneling in World War I. Considering the likelihood of combat in mines or against a subterranean-dwelling species, it stands to reason that future space armies might have special troops for the purpose.
I would imagine such troops would have advanced version of things like seismographs and ground penetrating radar. They would also need sophisticated equipment to detect gasses and places where air is too thin or humidity is to thick to breathe. Such conditions exist in Earthly cave systems. One cave with deadly heat and humidity had giant quartz crystals. Explorers must bring air and wear special suits to enter. Certainly, we may find cavern-dwelling aliens who thrive in that kind of environment. Indeed, some may thrive in any one or more underground environments that would kill a human. These same aliens may very well have a bad reaction to our air. I am reminded of the volcanic tubes in the Western Pacific that spout toxic fumes and great heat. Various crustaceans and other sea life have adapted to breathing it and thrive in that environment. Take then away from it and place them in normal seawater and they die and crumble rapidly. Certainly, there may be alien species living underground who evolved in a toxic (to us) environment or adapted to it. Going into their realm would be like entering the chemical warfare battlefield.
Other aliens may have taken to the underground to avoid harmful radiation or toxins on the surface. A cosmic accident, extreme series of solar flares or other misadventure might be the cause of their planet’s surface turning inhospitable. There was a very hokey movie titled "The Mole Men" that had a surviving Sumerian people who had adapted to living deep underground. The original Superman series had its own mole men in one episode. Horror movies dealt with things like CHUD (Cannibalistic Humanoid Underground Dweller) that were humans who had devolved underground. There are also urban legends of bums living in abandoned sewers and forgotten subways tunnels who devolved into something creepy. Imagine a civilization where part of the populace was forced to take refuge underground to escape persecution or as a result of losing a war. There may very well be a war between underground and surface societies.
What with archetypes and mythology, the underworld has always figured in the science fiction, horror and fantasy genres. The popular Dungeons and Dragons nerdware originally based itself on a subterranean adventure. Now there are millions of nerds playing it. Movies have dealt with underground themes, from radioactively-altered giant ants in "Them" to the Martians concealed in their underground lair in the 1953 movies "Invaders from Mars". There is a primal aspect to the subterranean monster genre. We shall leave further discourse on that to adherents of Dr. Jung’s work on archetypes.
We may find anything from hostile aliens, giant monsters or worse on our journey to other worlds. It stands to reason that special units may be needed to handle them. I wonder if they will be an elite force of individuals with a penchant for spelunking. On the other hand, underground combat duty might be a place for commanders to send their misfits and troublemakers. An unofficial punishment duty and convenient place for commanders to dump undesirables is as old as armies themselves. The U.S. Air Force used to send troublemakers to a stint at Thule, Greenland. Maybe a subterranean unit will be composed of a handful of elite specialists and a rank-and-file of the dregs of the army. Then again, it may be an all-elite unit or a group of misfits with few qualifications and little additional training.
No doubt some specialized heavy equipment, weapons and vehicles will be in order. I think of the long line of vehicles railroads use to replace ties and fix roadbed. Imagine a similar device to place roof supports in caves so as to prevent collapse. There would likely be various troops carriers, drills, robots and drones for underground warfare. Some would be altered mining equipment of its time and some may be entirely original. I see crawling, slithering, rolling and small flying drones and robots playing a large role. As the rules of warfare may not apply to alien combat, I would imagine scientists would develop heavier-than-atmosphere gases to use against underground dwellers. We can be certain that despite technological advances, gas warfare will be as messy at it was in the trenches of World War I.
There may even be weapons to cause vibrations, like localized earthquakes, to collapse tunnels and caves at a safe distance from the operators.
One thing is certain: the Bugs of Starship Troopers are not the last work in sci-fi underground warfare. There will be more to come so long as popular fiction feeds off common archetypes.
(This is another part of the thought experiments inspired by science fiction. It is not an answer, but a starting point for further thought. Hopefully the article will inspire writers, toy soldier collectors and battle gamers who enjoy the science fiction genre.)