If you can detect unusually large quantities (superabundance) of Xe-129 or higher isotopes of Xenon that would naturally only be present in trace amounts without explosions of thermonuclear weapons, then yes. Potentially even millions of years after the event (Xe-129 has a half-life of 16 million years). It is hard to estimate what weapon yield would be detectable at what distance, since that also depends on sensitivity of equipment used, but high sensitivity astronomical spectroscopy is something within our reach and to some extent already used to such precision to detect chemical composition of exoplanetary atmospheres.
Emissions of visible light, heat, and in radio frequencies by such weapons would likely wash out in the glare of the star and remain undetectable compared to star's own emission variability in both intensity and spectral emission lines or simply producing large enough flares though, unless you happen to have a large orbital occulting disk / coronograph deployed with telescopes pointing directly at the event, or we're talking of weapon yield in the order of being capable of nuking a whole planetary system with a single blow. Let's call it nova class for the fun of it, since it would produce a debris cloud not unlike one produced by a nova.
There's an, erm, interesting related document you could read that discusses detection of thermonuclear explosions after the fact, written by John E. Brandenburg and titled Evidence of a Massive Thermonuclear Explosion on Mars in the Past, The Cydonian Hypothesis, and Fermi’s Paradox. It's a tad eccentric, but nonetheless an interesting read. And the science of detecting such weapons is sound, even if it might be better to take conclusions drawn with ample reservation.
Another possibility is looking for flashes of gamma rays produced by nuclear weapon detonations where we know such emissions shouldn't exist naturally (say, no background gamma-ray burst emitters). And such explosions, if they occurred on planetary surfaces, would result in other changes to their atmospheres, such as change in their opacity due to onset of nuclear winter, and similar technosignatures we might be able to detect given long enough observations. See e.g. Observational Signatures of Self-Destructive Civilisations, A. Stevens et al. (PDF).
According to this paper, rephrasing, we're currently capable or have good prospects of soon becoming capable of (with launch and deployment of JWST) detecting signatures of active or dead civilizations that are or were using nuclear weapons within 5 years between destructive event and observations, and for planetary scale nuclear annihilation around nearest stars, by using gamma ray detection and transit spectroscopy techniques.