Here in the US, involuntary patients can refuse medications or participation in treatment. Refusals are documented and treated as they would be with a voluntary patient.
However, they can not refuse if the medications have been court-ordered, which is usually a separate legal process from a commitment hearing. Being involuntarily committed doesn't necessarily mean they're court-ordered to take meds. Even in those cases, it will be written to give a patient options as to administration, such as letting them choose to get it PO or IM. Or it will be written to be given a certain psychotropic IM only if patients refuse the rest of their medications, such as "Zyprexa 10mg IM given if patient refuses any psychotropic med". If the patient takes their meds the Zyprexa isn't given.
The other time they can't refuse is if they are determined to be an immediate danger to themselves or others--then it's an emergency situation and we are acting for their own and/or others' safety. But that would be something to be used only if all other (less restrictive) interventions fail, because it's essentially chemical restraint.
Hope this helps!