Warning!: I'm not a teacher.
At (occupation, organization, place of work…)
In (kind of building, the inside of a building, the building itself…)
She is at hospital (she works there)
She is in hospital (she is ill)
We also may be working in a factory. However, if we are at hospital, school, the office, the firm or company premises; we are working there.
Your E.g. He works at university…
You cannot use “in” instead of “at” with any of the sequenced words, with the exception of the word “hospital”, bearing in mind the difference in meaning mentioned above.
Student or Learner