You can say: "He works AT a pharmacy."
at a place = within its boundaries. This can be inside a building or in the space surrounding it.
in a place = strictly inside.
That is why you say "in an office". But sometimes you are "at the office", meaning you are not strictly inside the office, you are just at work. (You could be out for lunch)