yes, the terminal school matters. which is why people care about the quality of the undergrad school they go to. most people don't know whether or not they are going to pursue a masters. if they at least go to a decent undergrad school and they wind up not pursuing the masters they still have viable career options. beware premature optimization.