You can apply to any program you want for clerkship/residency.
There are a couple programs in pod school metro areas that have a strong relationship with one particular school and some/all spots reserved for students from that school. I don't think they can flat out say that unless they drop out of CASPR/CRIP, but it's not hard to know which programs they are if you ask students/residents in the area. Regardless, that's only maybe 10-20 entry level residency spots of the 400+ in the nation. IMO, those programs suck anyways... their thinking and procedure selections get inbred pretty fast if they are resistant to bringing in fresh student/resident/faculty prespectives. You will see that most of the best programs have attendings, residents, alumni, etc from many schools.
By and large, you can do pretty well if you are a good student. If you are going to a far away program that doesn't usually get extern/resident applicants from your school or has had a bad student/resident from your school recently, you may have a lot to prove, though. Rumors can have you starting a bit behind, but they are pretty easy to dispel if you perform well.