That (or providing sufficient nuclear material and expertise to a non-state actor) is exactly the concern, and the primary reason that we don’t want nations like North Korea or Iran to develop nuclear weapon technology; even if their leaders are sufficiently astute to demur from providing such aid to incendiary parties, the potential for some rogue agent to provide or sell unsecured material is not insignificant (and is not just limited to minor nations; see Project Sapphire).
But the odds that these nations, even when run by despots, will intentionally initiate a nuclear exchange which would result in their inevitable destruction is remote. A more significant danger, on the other hand, is that they might mistake an innoculous event for threat and respond in kind, unintentionally fomenting exchange. This danger, however, is vastly more signficant for the developed nations which maintain large nuclear arsenals that are capable of initiating delivery within minutes, e.g. the United States, Russia, France, et cetera. For North Korea to build a weapon and delivery system and then operate it is still an extreme logistical challange, and one they are unlikely to engage in for any other reason than the belief that the destruction of their regime from without is imminent.
Stranger