Ukraine gave Russia the nukes it held within its border. Looking back probably not a great idea.
We're talking about a military coup in the United States, which is a big topic, but technically, very few tanks and bombs or jets or nukes are in states. In part, for this reason. They're on federal property. States have militias; the U.S. has aircraft carriers and cruise missiles. If a secessionist government tried to invade federal territory, I would be wholly in favor of a decisive (if compassionate) military response.
The bigger challenge, as it always is, is the people.
Anyone can declare anything. What matters is who the troops and missile launchers listen to. That’s the Pentagon.
Would soldiers who live in these states obey DC's order to kill their neighbors and friends?
They certainly might, depending on the circumstances. But it is unclear to me that the outcome would be simple.
This is a popular factoid, but it often leaves out the fact that Russia had the codes to use the nukes, the ability to maintain them, and that other countries (like the US) wanted the nukes out of Ukraine.
If they had kept them, it is far from clear that they would be a nuclear power today.