I've heard somewhere that beer is safe to drink after being exposed to radiation (like after a nuclear explosion).
Is it true? And why would it be safe to drink it while water would not be safe to drink while beer is mostly made of water.
Yes, it is true, the beer is safe to drink if it was closed. As it is would be with any food product, even water. If they were open, both could be contaminated with radioactive material from the air.
Things are typically not made radioactive by exposure to electromagnetic radiation, which is the most likely case for your beer, unless it is near ground zero, like in the article provided by @Jason_C. Some of our food, like meat, is purposely exposed to x-ray radiation. High energy electromagnetic radiation (gamma and x-ray) is ionizing, so it can affect atomic bonds and molecules, possibly producing different compounds (flavors) due to molecular breakdown.
If, by radiation, you mean neutron bombardment, then the Operation Teapot results show that only the bottles would have any induced reactivity, i.e. they would have become slightly radioactive. Only a few of the beverages closest to GZ had an "aged" or off taste.
The article mentions that the radio-nuclides produced on the bottles are short-lived (on the order of tens of hours) and the radiation levels recorded were 3000-4000 cpm, which is still pretty low (natural background radiation ~ 10-50 cpm).. So the bottles would be around natural levels in a few days.
Note: When talking about radioactive materials, the material is either radioactive or contaminated, and the energy and particles given off are radiation. So radiation is never 'removed' or 'spread'. Only the material can be spread.
TL;DR: If your beer gets nuked and survives, put in the fridge for a few days (decay time of bottle), then drink.