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 situations you can decide if you want to be immunized against a certain disease. In some situations you may need to be immunized to engage in certain activities or to travel to certain countries.
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.