Yes a school can get a court order to ban a parent or parents from the school property if the parent or parents are unruly or causing a problem on the school grounds.
That means that the parents kids can still go to the school but then the parents cannot go onto the school grounds unless they are needed for some meeting etc.
If the parents go onto the school property when they are banned from the school property then the parents can be arrested.
If you as a parent are banned from school property then you can move to a different state or somewhere else and move your kid to a different school where you can access the school property.
Most parents are not banned from school property though unless they do something bad enough to where they will cause a problem on the school grounds.