First, 40K is not a HFY setting. Just isn't.
Next, the Imperium may have a lot of mass behind them, but that doesn't translate to a linearly better force. They have systems and systems of resources, but are corrupt, selfish, zealous, incompetent, ignorant, stagnant, poorly managed, have poor communication, little centralized command, and little to no ability to actually replace any of their best stuff. Including space ships. You know, you get to the place where the fight is happening? They refuse to try advancing their technology or making new designs because grimdark. Humanity of 2018 has no such hangups.
The huge, untrained, uncoordinated brute with a sledgehammer does not win against a seasoned swordsman.
The point of using nukes isn't to use them in ground combat. Ground combat is the very worst way to fight imperial forces. They'll just keep dropping bodies on you until you die, and if you survive that for long enough more elite units appear to punch your teeth in. No, nukes are for space combat.
What we're seeing here is a bunch of guardsmen being dropped onto a "primitive human splinter world", except they get defeated by tanks that actually work and infantry who use actual tactics. Once that initial ground force is defeated by the earthlings, the imperial navy has to order some replacement guardsmen. If that second wave arrives, the earthlings are pretty much doomed. But this is 40K grimdark verse we're talking about here, reinforcements take years to arrive. And while you're traveling through the warp, the earthlings are TRAINING.
They'll take every bit of IG tech they can get and study the crap out of it. Sort the useless barely-industrial crud out from the remaining glimmers of DAoT splendor. Scale it up, make it their own. That turns getting to space from hard and expensive to trivial. What did the guardsmen arrive in? Shuttles that can fly from orbit to the ground and back without refueling. We'll take those~
Now you have earthlings with easy access to space as well as nifty tech like efficient batteries upscaled from lasguns. We have a lot of nukes. A lot of them. Now we can put those in space for cheap. The imperium find it rather difficult to replace destroyed ships. It doesn't matter how many guardsmen or even space marines you cram into a ship if it takes 100 nukes to the face the moment it jumps into the system. The imperium has countless bodies, mass produced armor, and mind-bogglingly deadly elite troops of a hundred different flavors. None of them can travel through space unaided. None of them will survive the ship they're riding disintegrating around them.
"What's that system?" "That's sol. We don't go to sol."