Actually, JT, the only origins given for Unicron and Primus in G1 was in the Marvel comic, where they were both rather organic-looking gods. Unicron was the Chaos Bringer, who longed to destroy the universe and live in nothingness. He had, in fact, destroyed at least one universe. When fragments of the previous universe collided and caused the Big Bang which formed ours, Unicron was awakened and immediately set about destroying everything again. The universe created Primus to stop him. The two battled for eons, too closely matched for either to win, in both the normal universe and the astral plane. Finally, realizing the stalemate and the danger posed to the universe by their battle, Primus tricked Unicron and trapped the two in different barren planetoids, which were sent to opposite ends of the universe. Unicron soon learned how to transform into a mechanical version of his former self, and began to destroy things again (only much slower, because he was trapped in a physical form). Primus created two races of robotic beings that could transform (much like Unicron). To one of these races, he bestowed the Creation Matrix, which embodied most of his life force. Over time, the two races began a seemingly endless civil war, and became known as the Transformers. Only the power of the Matrix or a truly unified Autobot/Decepticon army could stop Unicron.
When Primus was awakened from his sleep during a battle, Unicron learned the hiding place of Cybertron. Optimus Prime attempted to unify the Transformers, but, for various reasons (Grimlock and several others being in unknown locations, and the inherent hatred Decepticons bore for Autobots), they were not properly unified when Unicron struck. Only Optimus Prime, restoring the goodness of the Matrix after it had been corrupted by Thunderwing and other evil beings, was able to destroy him, sacrificing his life yet again in the process.