How would nuclear deterrence work for small entities like Denmark or Taiwan against huge entities like US or China? it only works at similar sizes
It works as long as the harm that can be threatened is sufficient to outweigh any perceived gain of winning. Small states may not be able to sustain as large of an arsenal, but they also rarely offer as much value to a victor.
In every war, eventually, one side will be about to lose.
It is still risky of course and not advisable.