Generally you cannot be given medical treatment without your consent. This includes immunizations, although immunization may be a requirement to engage in certain activities. Certain types of medical care, such as assistance in dying, have special consent requirements. If you unable to consent the court can appoint someone to consent for you.
There are certain legal requirements that must be met before consent to medical treatment will be valid. These protect patients by requiring that consent can only be given by someone who is competent to make decisions and by requiring that consent be informed and voluntarily given.
In most cases individuals are not required to be vaccinated. However, not being immunized may restrict activities you can engage in or require you to take other steps to ensure that you are not a threat to the safety of others.
In some circumstances people who are very ill with something they cannot recover from can ask for medical assistance in dying.
If you are not capable of giving consent to medical treatment the court can appoint someone to consent for you. The court can also decide that you only need help to make decisions about medical treatment.