The proviso of this is that all the countries involved are led by sane, (reasonably) rational leaders. It also breaks down if they get into the hands of non-governmental forces. If they get into the hands of someone willing to act irrationality, a lot of people will be very screwed.
Interestingly, Ukraine was once a nuclear power. They had a significant chunk of the USSR’s arsenal. They decommissioned them, due to safety concerns. Part of that deal was protection from invasion (both from Russia and NATO). I suspect they now regret giving up their nukes.