We've all seen evidence of "unlikely allies" in
40k, but the tyranids are usually the impending doom instead of the ally since they're just space bugs.
There's only a few ways I could think this kind of situation might possibly work.
1. It's already proven somewhere in the books that with sufficient brain surgery re-wiring you can "tame" a tyranid. Though the test subject apparently immediately reverts to normal once it's in synapse range. If somehow the
IG managed to kill or suppress the Synapse of the nids and "coerce" the leading nid units to follow their commands, perhaps for a time the nids would calm down and fight off the impending ork menace. Maybe...
2. Already mentioned, that a genestealer cult is within the
IG and is slowly convincing the humans to stop trying to fight the nids, not necessarily join them (yet) but the nids know that a prolonged fight with the surprisingly tough
IG would leave them with too little biomass to survive the ork assault. The
IG commanders make something of a battlefield truce with the genestealers in charge, to fend off the ork invasion, knowing that even if they fought and won today, they'd stand no chance against each other. Unknown to either side of the conflict, the
IG are of course expecting aid to warp in sometime in the future and are really just buying time for them to arrive. The Tyranids are doing much the same thing, buying time, but really they don't expect to defeat the orks, they just want them to take as long as possible to claim the planet so the hive proper can get within range and not have to follow the waaagh any further.
3. A psyker cultist of Tzeech has found a way to emulate the synapse field of the Nids, and has actualyl used it to "fool" the
IG into thinking the nids mean them no harm, when it reality he's just fooling them all out of pure curiosity of how men and beasts could fight together. Unknown to him, the nid leaders are not under his control, but are pretending to be because such a strange alliance will get them past the humans defenses far faster than attacking them normally.
Just a few ideas. I'll admit, I love toying with the ideas of unlikely allies. Case and point:
Can you tell who's missing? It's a space marine. The black templar and the normal nids were the antagonists in this little scenario. hehe.