The sacristy’s proximity to the sanctuary is for practical reasons, but there is nothing in anything I’ve ever read that dictates it.
The church back in my home village was built about 80 years ago. There is a door from the nave to the sacristy, but there is also a hallway connecting the sacristy to sanctuary, behind the high altar back in the day when we had one, and now behind a half wall. Makes it much easier to go back and forth. From the mid 60s to at least the 80s, the entrance procession & recessional were always from the sacristy door, across the nave and into the sanctuary and vice versa, rather than from the door of the church at the back of the nave to the front. No, the Pastor was not seen shaking hands before or after Mass. I’m glad that has changed.
Perhaps my memory fails me, but I can’t recall an entrance procession when I was a kid. Father and the altar boys always seemed to magically appear in the sanctuary from behind the altar.