Galactus and Thanos have engaged in battle once in the 2004 comic "Thanos: Epiphany #5" by Jim Starlin. In the story, Thanos and Pip the Troll enter Galactus' ship with the intent of destroying it to prevent Hunger, Devourer of Realities, from being released. Although Thanos tries to warn Galactus of the danger, the supreme being doesn't listen, and a skirmish between the two ensues.
While Thanos puts up a good fight, he is overwhelmed by his adversary. Although Galactus doesn't kill his nemesis, it's all too easy to imagine him doing so. The only reason Thanos stands a chance against Galactus is thanks to the might of the Infinity Gauntlet. Even with only one or two of the Infinity Stones, Thanos holds the highest power in all of Marvel and could potentially have defeated Galactus with more time.
However, there is a deadly catch to this. Galactus is more than a simple bad guy; he is one of the most important beings in the Marvel Universe. Having been created by the all-powerful Eternity, Galactus harbors the destructive entity Abraxas inside of him and suppresses the being from causing havoc. Should Galactus be killed, Abraxas could be released and spell disaster for the universe as a whole. Even if killing Galactus was a snap for Thanos, the aftermath would be anything but.