One of two things must be true. There must be the genuine ability to choose a school where corporal punishment is not used, or an opt-out provision must exist.
I suspect that’s overcomplicating the world for the sake of it .
As the European Court of Human Rights ruled 30 years ago, subject to treaty obligation into which countries have freely entered, there is nothing to prohibit corporal punishment EXCEPT that parents who object on religious or Philosophical grounds MUST be given a mandatory opt-out..