If a country became victim to a nuclear attack, it would be virtually impossible to survive. So why bother preparing against one?
Hiding under your school desk and all those other safety procedures seem resundant
Engineer, not historian here, answering what is in effect an engineering question.
It's all about risk mitigation. A nuclear attack does not guarantee that everyone everywhere will die. First of all, a nuclear state only has limited capacity, even a major one like the US or Soviet Union. You're going to attack major installations. We actually have declassified documents showing nuclear 1950s nuclear targets for the US. There's a neat little map here (don't trust the "detonate" feature). You can see that some places, like Moscow and Leningrad (St Petersburg) get totally covered, but there are still huge chunks of Russian nukes that go uncovered. The same would be true in the US. If you live in DC or New York City, you're probably fucked by a Soviet nuclear attack. If you live in the rural Great Plains, you're much less likely to be targeted.
Then there's the lack of guarantee that a nuclear strike would actually be that big. Does a nuclear war actually entail the Soviet Union and US unleashing their full arsenals at each other? What if the nuclear strike originates from France (which joined the nuclear club in 1960 and kept a lot of independence from NATO) or from China (1964, very separate from the USSR)? What if the strike is a really fucked up accident, and one or two missiles are independently launched?
And let's say you do know that the other side wants to launch an entire arsenal of 1000+ warheads. What if you manage to take out a substantial chunk of the opposing side's nuclear capabilities in a first strike? What if it turns out their tech just isn't very good and a substantial number fizzle? Nuclear warheads come from the "nuclear triad"--ICBMs, subs, and bombers--what if you're able to take them out? Investing in anti-air capabilities can help prevent bombers from striking your mainland. Missile defense systems are newer but can help stop the threat of ICBMs and boomers (the most famous example is the "Star Wars" program started by Reagan).
Now let's say it's too late for that. A missile is going to hit your city. What does that mean? This part is really why I mentioned it's really an engineering problem earlier. A nuclear strike releases energy in a few ways. There's the blast itself, a wave of force radiating from the detonation point. There's thermal energy, a big fireball. Then there's the fallout, the long lasting radiation that makes people sick and is why we still can't just walk around Chernobyl. If you're right at ground zero, you're fucked, game over, nothing anyone can really do about it. But as you get farther and farther away from the blast, it does less and less damage. Maybe a mile away from ground zero, it still does a lot of damage, but isn't totally destructive. Maybe two miles away, you definitely notice something happened and it might still hurt you if you're unlucky, but you're probably safe. And maybe three miles away, all you notice is a blinding light but are otherwise totally safe from even the potential of harm (all distances here depend on a lot of factors, I'm just making them up off the top of my head as an example).
So crouching underneath your desk isn't going to help at ground zero, no. But farther out, where there's still a destructive blast force but it's not as strong, it can help. It's like a tornado or earthquake, you take steps to protect yourself from debris and from the chance of harm. Radiation damage works the same way--if you're far enough away being in the radiation for a short period isn't going to kill you, and it's possible to take steps to protect against radiation exposure to help even more. Actual bomb shelters of course are even better, to varying extents. Someone in a homemade shelter can survive a bit closer to ground zero than someone hiding under a desk, and complexes built into mountains for VIPs or for military bases can be pretty much impregnable.