If you can't keep the city you conquered because of loyalty issues, you conquered the wrong city at the wrong time.
I've played plenty of domination games without any loyalty issues. Governors give +8 loyalty, fortified units cancel occupation penalty (leaving only grievances to original founder penalty), if you have a religion and spread it to the city that's another +3 loyalty per turn, 240g buys you a Monument for another +1 loyalty, Viktor has a promotion that gives nearby cities +4 loyalty per turn, put him in a city next to the problematic one, there's a policy card with +2 loyalty from garrison, there's a policy card with +2 loyalty from governor in city. That all together is 20 loyalty. Assuming happiness is neutral, the only loyalty penalties that remain are pressure from nearby cities and disloyalty from grievances.
In other words, if you really want to, you can keep almost any city. There is of course the opportunity cost of employing every single one of these tactics, but then, it shouldn't ever get this bad. -20 loyalty pressure from nearby cities really doesn't happen unless you're conquering in a dark age (which is just dumb) or you're conquering a city that's completely isolated from your cities, in which case I say: build or conquer cities in between your empire and the city you want first. Expand before exterminating. And as for the grievances penalty... I've seldom seen that get worse than -5 even in long wars. Just don't rack up too many grievances, pick your wars smart, don't surprise war, etc.
Also, if despite all this you can't keep a city (which, I have to admit, does happen on occasion to me as well if I'm thrust into an unfortunate situation), just make sure you're immediately ready to re-conquer it. It won't have walls unless you built them, as walls are destroyed upon conquering. Units with equal combat strength to an unwalled city can bring it from full health to zero health in about six attacks - that's two turns of three units attacking the city, which you can probably keep for at least six turns even in a dark age and without dedicating your government to it just by slotting in a governor and keeping a unit on guard. And in those six turns, you can conquer another city to bolster loyalty.
Also, general advice: Don't go to war unless you have resources, make sure you're at least equal on tech when going to war, or preferably ahead, and plan your war before declaring it, including things like how you will invade, how you will play around loyalty, et cetera.