I'm not sure when the book was written, but I read it in the early 2000s
I remember that early in the book, the soldier protagonists were on earth in the future. They were in a skirmish near the pyramids(which had been encased in some kind of protective coating). Their weapons were invisible lasers(which I believe they could see with their infrared goggles). They also used a kind of "napalm" that was described as a huge number of "match heads" that would all ignite at once.
Eventually they are stranded/pinned down on an alien world(Jungle, I think, but I'm not sure of that). They are attacked by the humanoid natives, who are capable of using the soldiers weapons- I specifically remember the soldiers targeting any alien(though I guess the soldiers are the 'aliens' by this point) holding one of the human weapons, hoping to convince them it was a bad idea to pick them up.
Edit: these are marines/soldiers in space, not 40k-style space marines