In The Lord of the Flies, it is pretty clear that there is some sort of war going on outside of the island (the dogfight that leads to the dead pilot, the naval ship that rescues the boys at the end, the evacuation of the boys). The vibe I got was that it was WW2. It wasn't explicit, but the book was published not long after the war (1954) and Golding fought in that war and just the overall tone seemed to fit.
It's admittedly been a little while since I read the book, but I don't think that we have to assume that it was nuclear. The book is quite explicit that there was some kind of war, and the implication from the end of the book (with the naval ship visible at the end) that it was brutal and in some way analogous to the war that took place on the island, but it never says (or, to my knowledge, implies) that it was nuclear; the story line could have just as easily applied to a conventional war.
For example, according to Wikipedia, Germany launched 1,402 V-2 rockets at the U.K., 1358 of which were launched at London. These missiles weren't especially accurate, but they were spectacular at intimidation; they could, as I understand it, fly above the cloud cover, so from the observers' perspective, they "appeared out of nowhere" with little warning and at seemingly arbitrary targets. (The fact that nearly 97% of them were launched at London gives you a sense of how extensively the city was targeted during WWII).
It was actually quite common to evacuate people (especially children) from populated areas, and that did actually appear in literature of the time. For comparison, in the Narnia series, The Lion, the Witch, and the Wardrobe is quite explicit about the fact that the Pevensies had been sent to the country to escape the bombing of London. There was never a nuclear bomb detonated in the U.K. (although the book was written after the nuclear bombing of Japan). Although this book was obviously written by a different author for a different audience, the point is that this kind of evacuation was hardly unique to Lord of the Flies, nor was it all that uncommon historically (especially in areas like London that experienced heavy bombing), nor do we have to assume that authors were referring to nuclear weapons. Conventional warfare was more than brutal enough to justify the evacuations.
I remember seeing an interview with the publisher back when I studied it in school. In the original draft first chapter outlined a nuclear war and was implied to be a bit over the top, most publishers hadn't gotten past it and refused the book on the basis of the first chapter thinking the book to be mainly about a nuclear war. This introduction was gotten rid of in later drafts. I saw your question because I thought of it randomly and wanted to see if there was a copy out there so I started googling.
I saw this on the Times of London website: https://www.thetimes.co.uk/article/editor-demanded-cuts-to-absurd-lord-of-the-flies-dnxsdp0nnln