Sometimes. As a college professor, you will be hired within whatever subject you have developed as your area of specialty. Your sub focus within that can become a kind of professional calling card for you, making you an attractive candidate for schools seeking an instructor with a particular body of knowledge. However, it helps to have generally applicable knowledge within your field, as many professor positions - in particular those for new professors - mean teaching several classes simultaneously. It is usually only upon advancing to a more senior level of professorship that you will have full control over which courses you teach.