It doesn't really make sense to talk about what they can do. The government can do anything it wants to do including draft civilians to deploy. You aren't protected from deployment as a medical student because of your status; you are protected because you are useless. As a resident, you are less useless but it still is exceedingly unlikely that pulling you out of a training program to deploy somewhere is the best option available to them. A more realistic concern is unrealistic expectations on how often you can make it to drill, AT, or go to some 3-4 week training rotation.
If you don't want to deploy at all, joining the military is a terrible choice. If you don't want a deployment to interrupt your training, I would not be particularly concerned about joining the Guard or Reserve.