It’s easier if you go to a smaller school with smaller classes so the professor will know your name just from going to class. But if you go to a large school you can meet them in office hours to ask questions so they can get to know you better
For me personally, I went to a large school so most of my prerequisite classes had hundreds of students, and going to office hours or staying after class to talk to the professor isn’t really my thing. So I literally just emailed some professors when I was applying to PT school and told them my name, which course I took with them and when, and what my grade was, and asked if they could write me an LOR for PT school. Most obliged. Obviously it was likely a pretty basic LOR since they didn’t know me personally, but having a basic one is better than not having it at all if it’s a requirement
Then I used my time during observation hours to get to know the PT’s I was shadowing to ensure I’d have really positive letters from them. It’s much easier to develop a relationship with them than it is with professors in my opinion. Also I knew I’d have a really strong LOR from my employer, so I figured a basic one from a professor wouldn’t be the end of the world