Out of all the versus battles, this is one that stands out as rather interesting since the two combatants are more alike than many of the others. Galactus is a world-devouring giant, while Unicron is a world-devouring giant that is an actual world unto himself. The world-sized transformer was shown to be an unholy terror in The Transformers Movie back in the 80s since he kept his planet shape for a good part of the time and even showed that he could create his own heralds when he took in Megatron and his henchmen and turned them into Galvatron and his minions. Unicron has a wide array of powers that a lot of those that love the Transformers probably don’t know about, but the thing is that Galactus has roughly the same array of powers that can help him to stand toe to toe with the metal monstrosity that exists within Transformers lore. Pitting these two against each other would be an insane battle that could very easily decimate a galaxy, let alone a world.
One thing about both of them is that they are incredibly ancient and have existed for long enough that people on many worlds have considered them to be a myth or a legend. In the Marvel universe though, Galactus became a painful reality for many people whose worlds he managed to consume in order to keep himself going. Unicron is about the same in this regard as well since he needs to consume planets for energy as well. But there are various differences between the two apart from the fact that Galactus is a flesh and blood figure with armor on, while Unicron is an entirely metal construct that can change shape and do a variety of damage in either form. Galactus doesn’t change form, but he doesn’t need to really since he’s powerful enough as he is.
What really separates these two is, if you can believe it, strength. It’s very easy to assume that Unicron might be able to lift more and hit with a heavier punch than Galactus since he’s a Transformer and he’s made entirely of metal. The fact that Galactus is flesh and blood would get a lot of people to believe that Unicron might wipe the floor with him, but that’s not the case. Galactus is insanely tough, and while he’s not nearly as durable as Unicron, he’s a great deal stronger and in a slugfest, this fight would no doubt be a little more even than people might think. The truth of it though is that the impact of their hits, if they did go at it in this manner, would be strong enough to pulverize whatever was around them. In space, it might have as much of an effect, but on any planet where matter could be disrupted by the massive collision, it’s fair to say that the two might actually destroy a world with their combined fury. But when the story is done and everything is laid out, Unicron doesn’t really have what it takes to beat Galactus, even if his size is impressive and his power is immense.
One thing to remember about Galactus is that he can alter his size, he can control his body, and he’s as close to being god-like in the Marvel universe as anyone can be without taking that final step. The things he can do would overwhelm Unicron, but the planet-sized Transformer would definitely put up a good fight considering that he’s big enough to be a threat, and he does have his own slew of abilities that he can bother Galactus with. The problem here is that while both characters are insanely strong, consume planets, and are feared by a lot of people that are considered to be beneath them, Galactus would take this fight simply due to the nature of who and what he is. The fact is that Unicron’s status as a planet unto himself is that he would be another target for Galactus, meaning that the world-devourer would look at Unicron and see another source of energy, but not much else. Plus, the arrogance of the two when it comes to thinking they’re unstoppable has been proven to be false in the face of a single item that can defeat them.
Galactus is a little more vulnerable to many attacks apart from the Ultimate Nullifier, which inspired actual fear in him at one point, but he’s also resilient enough to take such attacks and turn them aside or recover quickly to head back into battle. Unicron was destroyed by the Autobot matrix of leadership at one point, but much like Galactus is capable of being damaged, but not substantially enough that it will kill him. In open battle, Galactus would take this fight without question, but it might take a while to score a victory.