I don't know how the visa rules would work, other than that when you are a student, you have a different visa than if you are employed, so once you graduate, you would have to reapply for a new visa. If your intention is to attend school in the US and then remain in the US, it is better for you if you can start applying for permanent residency as soon as you can (there are long waiting lists, and I really don't know how all those rules work). Visa issues aside, in terms of simply being eligible to practice here, if you study in the US and pass the licensing exam in the US (all levels), then you would be able to practice in the US. If you study abroad, even if you pass the licensing exam, you may encounter trouble being allowed to practice (more often, people from abroad simply can't pass the licensing exam without having gone through the US medical education system).