Obviously, putting publically-accessible areas within an airport's apron, taxiways, or runway environments is normally avoided as much as possible. However, sometimes space constraints don't give you another option. As Federico mentioned in a comment, Gibraltar International Airport is a famous example of this. A major city street runs right through the center of the runway:
Gibraltar International Airport's runway with traffic on the street stopped for BA aircraft
In this case, the runway runs the entire width of the peninsula. Obviously, they had to allow traffic to pass back and forth from one side to the other somehow, so one of the main city streets passes right through the middle of the runway and they just stop traffic on the street when the runway is in use.
Of course, another way to solve this problem is to do what Nashville International Airport and Atlanta Hartsfield-Jackson International Airport (and probably several others) have done and just send the road through a tunnel under the runway. I'm not sure how feasible that would be at Gibraltar's low elevation, though (i.e. might have water problems in the tunnel.)
Murfreesboro Road passing underneath Runway 2C/20C, Nashville International Airport
Interstate 285 passing underneath Runway 10/28, Atlanta Hartsfield-Jackson International Airport
I would expect that the main reason where you have situations like the one in Gibraltar is probably economics. For low-traffic airports, it's a lot easier to just stop the traffic than to build a big tunnel capable of supporting a large aircraft. For higher-traffic airports (like Nashville and, especially, Atlanta,) though, the tunnel is required as there are flights landing or taking off constantly (not to mention the security and safety risks of having cars driving around within the airport.) According to its Wikipedia page, Gibraltar International only has about 10 flights per day (3,564 total in 2013,) so it's manageable to just close the road when the runway is in use. I expect other airports with these sorts of crossings will be similarly low-traffic airports (or, at least, a low-traffic part of the airport.)