Just like a breathalyzer or field sobriety test - you have the right to refuse.
There are consequences, though...
Different situation. Driving involves implied consent. IANAL.