In Civ 4 the AI did build nukes on a rare occasion, and in that case it was likely a superpower Aztec civilization.
What I found out in some Civ4 scenarios, where the nukes are prebuilt for the AI, is that it uses them in war very eagerly. In a Cold war mod scenario the Americans (AI) got mad at the Soviets (me) for spy-sabotaging one of their uranium mines (I don't know how the AI knew it was me, though) and declared war on me. They launched all of their nukes at turn one on Moscow, Leningrad, Beijing and some to India (soviet ally). It was actually quite interesting, since the AI had to know I had nukes in range to all of their major cities (subs and ICBM) plus a gigantic force ready to invade Western Europe. In many games a Sino-Indian war ended in the Chinese nuking all Indian cities.
So far I haven't encountered a nuke-building AI in Civ V. I hope It has been made more aggressive when building nukes and more thoughtful when considering how to use them.