Considering only Warhammer, I don't know of
Moon-sized creatures from the alternate dimension that is used for hyperspace travel. They can sense the mental energies from psionic humans ... that they will exterminate entire planets to be rid of it
Warp creatures
When looking at the Warp, there are two different kinds of entities in it:
- Daemons
- Enslavers
Daemons
Can feel psykers and use them to travel to the physical universe, using them as a gate. They then do whatever they like to do, based on their deities preference.
Enslavers
Were the beings destroying the Old Ones.
The growing pains of these Young Races disturbed the peaceful Empyrean, turning it into a hellish environment filled with now-deadly Warp predators. Eventually, they broke the boundaries between dimensions and amongst the most proficient of these Warp-spawned creatures were the Enslavers. Using their mental powers, they dominated the minds of the Young Races and used the transmutated bodies of Psykers as portals to bring more of their kin to the material universe. The arrival of these Warp entities brought the final downfall of the Old Ones' reign as their own creations fell victim to the command of the Enslavers. Breaching the Immaterium in epidemic numbers, the Enslavers would take what was left of the galaxy whilst the C'tan retreated to ride out the storm.
From the Lexicanum article on Enslaver
So, they were created by psykers and the War in the Heavens and destroyed basically the galaxy as is. However, their size is far off the moon sized creatures you've described. From above quoted article:
In shape, they appear as barrel-shaped or basic spheroids that measured approximately 2 meters in height and had a tough leathery skin.
Once some Enslavers have infested a planet, they use other psykers to create more portals, thus having more enslavers passing through and so on, until the planets needs to be terminated. Again from same source as above:
Enslavers are slightly larger than a grown man, however other size ranges are possible as the former has been the average assessment. These xenos have sac-like bodies which contract with movement and are almost completely transparent, the front is recognizable by numerous tentacles originating from the anterior end and down to the posterior along the bottom. The face of the Enslaver is an almost mask like visage with numerous eye-holes of differing sizes. An Enslaver also possesses the abilty to phase in and out of the Materium as it manifests from a psyker. The creatures possess psykers as daemons would, yet do not show any outward signs of possession, instead working clandestinely to further it's own ends -- ultimately the possession of other psykers to allow the passage of more Enslavers. Unlike daemons, Enslavers can control non-psykers, which they consume the minds of, furthering their own power and allowing the control of more potential slaves. Eventually, with enough Enslavers or one of extraordinary power it may be able to control an entire Hive of humans and then spread across the planet, after which the only acceptable plan of action is Exterminatus.
Now, looking at
Moon-sized beings
Again two coming to mind:
- C'Tan
- Men of Iron
C'Tan
It is said that the C'tan were born during the creation of the universe itself, formed of the insensate energies unleashed in the churning mass of unimaginable force. It was long before the planets first formed and cooled that the first self-aware entities emerged from the seas of plasma and solar flares. While these creatures would later be known as the C'tan, during the early stages they bore little resemblance to the terrifying entities they would later become. At these early stages they were merely monstrous parasites suckling upon the stars that bore them, shortening their lives by uncounted millennia. In time, these star vampires learned to fly on diaphanous wings of magnetic flux, leaving their birthplaces drifting to new feeding grounds. They paid no head to solid matter for the internal fires and electromagnetism of the new-born planets were insufficient to register their on their monstrous hunger.
From the Lexicanum article on C'tan
So, they used to be huge beings but, at that point, with no interest into planets. This changed when the Necrontyr gave them bodies of living metal:
C'tan known the Aza'gorod the Nightbringer, which was born upon the very star which the Necrontyr first lived their brief, morbid lives. Upon manifesting across the incorperial starlight bridge, the Nightbringer was incarnated within a body of living metal (necrodermis) and brought with it the curse of death. Having fed upon the flavourless power of a star, the Nightbringer found delight in the Necrontyr's awe and fear, and had begun slaughtering those which had brought it into being, feeding upon their terror and suffering.
However, there is no connection of the C'Tan to the Warp:
The major weakness of the C'tan is their inability to comprehend the warp.
Men of Iron
Not that much is known about the Men of Iron.
In the cryptic account of the ages of Mankind given by Cripias, one of the Keepers of the Library Sanctus of Terra, the Men of Iron were legendary sentient humanoid machines created by humans during the Dark Age of Technology.
From the Lexicanum article on Men of Iron
There were some gigantic ones (emphasis by me):
The Men of Iron employed world-consuming constructs, devices that could destroy suns, weapons that could throw entire continents into the heavens, and swarms of nano-machines that covered entire planets.
It is also rumoured that they rebelled against humanity as they saw the threat of Chaos and opted to destroy sentient beings to kill it off.
Conclusion
I don't think that any of the authors used WH40K as an inspiration for those creatures. They may've used the Warp as an inspiration for the alternate dimension but Warp-beings don't mind psykers at all.
Here, I feel more remembered at The Expanse:
According to The Investigator (after being re-manifested by James Holden during the events of Leviathan Falls), the beings responsible for the destruction of the Ring Builders exist within a larger, older universe (or some other form of separate reality) within which the bubble of "normal" spacetime constituting the Slow Zone is embedded. The universe beyond the borders of the Slow Zone exerts a tremendous "pressure" on it, and the Ring Station utilizes the energy of this pressure to power itself and maintain the integrity of the Slow Zone. However, in doing so, the Slow Zone continually leeches energy from the surrounding universe, incurring the apparent animosity of the entities which live within it.
From the The Expanse Wiki article on Ring Entities
I however highly doubt this is the first occurence of beings from another universe able to destroy whole worlds cause humanity is using some power or technology they don't like.