For BS, whether or not you apply from the beginning or during sophomore year depends on the school. Look into each individual one in their course catalog.
For MS, it also depends. Some schools do offer joint programs, while there are also plenty of standalone programs. Colleges look for excellence in the field for graduate admissions, and don't really use a holistic approach as undergrad admissions do. If you're applying to PhD after BS, then research is quite important.
I think most people do their PhD at the same place as their MS though, probably so they can work with the same advisor throughout. There's no point in changing schools between MS and PhD.