There’s probably many different examples and types of these things that vary from region to region around the world.
Here’s a US perspective.
I live in NY and there is a large number of Roman Catholics. Public schools here are not allowed to teach religion. Global and Social Studies classes are allowed to teach about religion but in an informational manner just about what the beliefs of each type are. I remember in like 7th and 8th grade learning about Islam, Hinduism, Buddhists, etc.
Direct teachings from scripture or holy text would have to take place in a house of worship. Church, Mosque, etc. This is because public school systems are state funded and there’s an established separation of church and state.
Back to my experience, about 25% of my classmates growing up were from Catholic families. To accommodate their need for religious learning, every Wednesday, after lunch, all the Catholic children were dismissed and bussed to their church where they had CCD (Confraternity of Christian Doctrine) classes for the remainder of that afternoon.
If accommodations like this aren’t met for a group of people that are a sizable percentage of the community it could be viewed as religious discrimination.
On the other hand, if religious teachings start to make their way into public schools, many interpret that as a direct violation of the US Constitution and an attack on religious freedoms.
This is an ongoing, ever present issue in the US. Especially in heavily Christian communities.