Education and Training Act 2020, s 50
Yes. If you’re under 16 then your parent or guardian can write to the principal at least 24 hours before the class and ask for you to be released. If you’re over 16 you can ask the principal without parent or guardian permission.
Then principal can excuse you if:
they’re satisfied you, or your parents or guardians, have sincerely held religious or cultural views, and
you’ll be properly supervised while you’re out of class, either at school or outside school.
This right doesn’t apply to integrated schools. See “Integrated (formerly private) schools”