I ask because I was driving in front of a cop as I passed a church yesterday. Thought it would have been humorous if I got pulled over for some minor traffic violation but ran into the church instead and yelled "Sanctuary!"
The origin is Biblical. The Old Testament and the Talmud describe sanctuary cities where a murderer may flee to and live in exile.
You may be interested in *Sanctuary and crime in the Middle Ages.
This practice has not died out, at least not in Canada. Here is a National Post article that delves into your question.