I remember reading an article at one point about a study done on high school students. I can't remember exact details, but there was a program where students in areas with bad high schools could apply to be sent to better high schools. If I remember correctly, admission to the program wasn't merit based, but first-come, first-serve. The study compared the students who got into the program, and the students who applie…
At least a good school does provide the opportunity, from stories I've heard from people who have worked at or attended bad schools it would be an environment where it would be basically impossible to learn anything even if you wanted to.