In what cases it is correct to say "in the school"? Are there any situations, in which that combination of words placed in the end of a sentence would be correct?
You can say
...in the school
when talking about something that happened, happens, is happening, will happen, or could happen, etc. inside the school.
There are 44 students and 6 teachers in the school.
I left my book in the school.
Tonight's dance will be in the school.
No strangers have been spotted in the school.
We don't like the food at the cafeteria in the school.
The flood damaged a lot of walls in the school.
An ant fell in love with another ant and had 6000 baby ants, and they now all live in the school.
Scientists think traces of radiation from the damage last year to the nearby nuclear plant can be found in the school.
In school vs in the school.
When you talk about activities other than school actvities, you use the phrase "in the school". Otherwise, you use "in school" about school/educational activities. look at the following sentences to distinguish between these phrases:
My kids are still in/at school.
Some visitors are in the school.
There is a canteen in the school.
The carpenter is repairing chairs in the school.
Not really, 'in the school' is perhaps more common American English while 'at school' is more British but both are equally 'correct'. Similarly an American would probably say 'in college' while a Brit would say 'at university'.
In tends to be used for institutions, so your are 'in hospital' or rather than 'at hospital' but 'at home' not 'in home' - although you might be put 'in a home'
It's just one of those things!
there is perhaps a slight subtle difference that 'in school' means they attend school - as opposed to having finished school, while 'at school' means they are there now. So "are your children in school" = are they under 16 or 18 ? But "are your children at school" = are they at school today or are they at home. (but that's from a BE perspective)