It's a tricky question. Obviously, bodily autonomy is a fundamental of any view of human rights, and compelling vaccination would certainly be a violation of autonomy. The question becomes whether or not the collective right of other people to be free from illness as a result of good herd immunity, overrides the individual right of a person to refuse medical treatment.
This is where I reach for my constitutional law (US) education, and pull out the concept of "strict scrutiny". In US jurisprudence, "strict scrutiny" is applied to a law when that law could breach a fundamental right, and/or discriminates by a "suspect classification" (such as race or religion). "Strict scrutiny" means that the law in question is subject to three tests: it must be justified by a compelling governmental interest
, it must be narrowly tailored
to meeting that goal alone, and it must use the least restrictive means
of meeting the goal. Exactly what those terms mean is defined more by precedent than by dictionaries, but I think the basic meaning is clear enough.
So, would compulsory vaccination for everyone (except those who cannot be vaccinated for medical reasons) meet the "strict scrutiny" tests? I'm not sure. I think it would depend on whether the government confined the law to children, or also compelled adults. Adults have the legal right to refuse medical treatment in any case*, even when it would endanger their life, and this principle should be upheld as matter of bodily autonomy. Children are a different matter.
There's a lot of precedent in common law, and in other legal systems, for the government having an interest in safeguarding the welfare of children over and above their own wishes, and the wishes of their parents if need be. This is why we have child protective services, for instance. The reasoning, obviously, is that children are more vulnerable, lacking the experience, intellectual development, and emotional maturity to make decisions about their own welfare. Leaving this up to the parents works most of the time, but the government has an interest in seeing to the welfare of children when the parents fail.
Any law which compelled parents to vaccinate their children would be one with the potential to violate the children's bodily autonomy, as well as the rights of the parents to religious freedom, if they had religious objections. So, it would definitely come under strict scrutiny.
So, first, what's the compelling government interest? I think the public health benefit of preventing deadly infectious diseases is a major one, especially given the facts about herd immunity. If unvaccinated children were at risk, without risking the health of vaccinated children, I would still say that protecting those children from potentially deadly illness is compelling enough, but the fact that they also put vaccinated children and adults at risk makes the case much more compelling. (Also, it helps that many vaccines are one-shot, lifelong protection types. As such, vaccinating children means they are still protected as adults.)
Is it narrowly tailored? Well, if we compelled all children to be vaccinated with the goal of preventing the spread of communicable diseases among children, I would say so. There isn't a better way to immunize than via vaccines, not that anyone has discovered. And herd immunity being what it is, only total or near-total coverage will work effectively. Also, doing so would not compel any other medical procedures.
Finally, is this the least restrictive means of doing so? Again, I would say yes. Compulsory vaccination does not put a great deal of onus on the child, or the parents, especially if the law that compelled it also provided funding for the vaccinations, so that they were free of charge for the parents. The law would have to exempt children who, in the judgement of their doctors, could not safely be vaccinated, of course; it's them that herd immunity is so crucial to protect.
So, I'd say that this would pass strict scrutiny, if it was aimed only at children. Requiring adults to vaccinate would probably not.
* Unless you're a pregnant woman, it seems