To Ally Grox:
First, fully upgrade your ship's energy storage, happy ray, and shields. Next, pick up several repair kits and batteries. Break galactic code several times for a large relationship bonus, then go to one of their planets and spam the happy ray. When you run low on power, use batteries. They will probably shoot at you, so use repair kits before you die. Eventually you'll reach a point where they'll sell you energy and health refills, and stop attacking you. Keep grinding their relation up, leave, and wait for alliance proposal. Everyone else (except those who really, really like you) will instantly turn against you, but with your new Ally, it won't matter.
To Exterminate the Grox:
Get as many monoliths and creature creation units as you can carry (and optionally the staff of life), and probably the tools to make planets T3 manually for good measure. Go around Grox territory, uplifting as many creatures as you can to space stage, creating life from scratch if need be. Save the Staff of Life for use on actual Grox planets. As soon as you create a spacefaring people, use your prestige to ask them to attack nearby enemies. The Grox will fall surely, under the swarms of dozens of new empires. As a plus, their former territory will be full of peoples who practically worship you.