When one goes to a place or a building for the purpose for which it is constructed, the definite article THE may be avoided.
- He is in jail.
(i.e., he is convicted of an offence and undergoing punishment)
- Renz has gone to school. ( to study)
- Soja has gone to church. (to pray)
- He is in hospital (for treatment)
Now differentiate with THE:
- The magistrate is in the jail (may be he has gone to the jail to make an official visit)
- Neethu has gone to the school (perhaps to meet her kid’s class-teacher)
- The mason has gone to the church. (for doing some brick-work)
- He is in the hospital (i.e., to visit his injured friend)
However there is one exception to this:
- He went to the office. ✓
- He went to office. ✗