I confess I don't have a lot of experience with getting nuked, but I tried to share what I do think you can do. I believe my best advice is what I've written in the last part, though.
Also, remember that if your enemy is just too militarily superior, there are other ways of winning the game!
How to stop nukes
Technically both atomic bombs and nuclear missiles can be intercepted by any air-intercepting unit (destroyers, AA guns, SAM, fighters and jet fighters), but they have a percentage to avoid the interception completely, and in practice I have never seen an interception actually stop a bomb or missile.
So in general - no, there's no way to stop them, at least not a reliable way. If you keep your cities far away from the enemy you can just focus on preventing enemy naval units (carriers, missile cruisers and nuclear submarines) from getting close enough - using your own submarines to patrol the waters is a great way of doing that.
In many cases there just isn't enough distance from their cities to yours, but even guarding some of your cities is useful - getting the capital nuked hurts more than letting some small border city get nuked.
Strategies to avoid getting nuked
The best way is to defeat them before they get the Manhattan Project done, of course, but that's not always possible. Just remember there's a global broadcast when the Manhattan Project begins, serving as a useful heads-up.
Another way is to team up with another civ and let them attack first, so they draw all the nukes. It's even better to team up with a nuclear-capable civ, that way you get a civ to waste its nukes on an enemy, instead of an ally; and you can later backstab the now-nukeless-civ.
I also think one of the best strategies is to prevent the enemy from getting Uranium. You can take the direct approach - conquer areas with Uranium, or use culture bomb - but that's not always feasible; a better way is to trade with them and get their Uranium. The AI often values luxury resources above strategic ones, so you can usually lure it to give you its Uranium - the exception is with hostile AIs, which practically never trade strategic resources away. In any case, even if the trade agreement is broken when the war breaks and they get their Uranium back, they won't have time for building a large nuclear stockpile.
If you're already in war, you can still tactically snipe their uranium. You can either do that by darting a high-movement unit inside and pillage the uranium mine, or - if you have nukes of your own - just nuke in the vicinity of the uranium and hope it will get destroyed.
Finally, you can counter with your own nukes. Atomic bombs will kill all units in the target tile, and a nuclear missile will kill all units within 2 tiles of the target, and this include air units, so if you find that they have stockpiled several nukes in 1 city firing your own nuke at it will take out all of them. In my current game I took out 8 English atomic bombs on the first turn of the war by doing that.
How to deal with getting nuked
Don't panic! Getting nuked is really not as bad as it sounds. I mean it can be a sign that the enemy is much stronger than you, but a nuke by itself is not the end of the world. While nukes are great against units, they aren't that amazing against cities - so you lose some citizens and health, and might lose the city, but that's alright. By the time nukes become available a few citizens here and there don't matter all that much, and in war the possession of cities is fluid anyway. Also remember nukes are expensive and Uranium is severely limited, so unless you're fighting Russia or a very rich civ, the amount of nukes they can field will typically be low.
Nukes are pretty effective against units, so my number one advice when fighting nuclear civs is to keep your units apart. This is easier said than done since this game really encourages units to work together (melee units with siege units, AA covering other ground units, etc.). Still, as long as the enemy has at least one nuke around, try and keep your units apart. What I usually do is leave a gap of around 1 hex between every two units, and I also try to split my forces into two "armies" to flank the enemy.
Alternatively I guess you can bait the enemy to waste its nukes on clusters of your weaker, cheaper units, while keeping your real units in the rear - but that never worked for me.
By the way, if I remember correctly, nukes can kill garrisoned units and air units inside cities; so I also recommend not basing too many planes or missiles in the same city, and if you fear a certain city is about to get nuked, get your highly-promoted rocket artillery out of there.