It's sort of like that and not at the same time. Under the UCMJ, refusing a lawful order can put you in the brig, or a variety of punishments applied (NJP, loss of rank, loss of pay, etc.). Under most circumstances, forcing a service member to ingest an unknown drug is not a lawful order. Under official civilian authority you can be highly encouraged to take an untested vaccine or some such, and refusal, while not disobeying a lawful order, can end up with you receiving unpleasant treatment. (You are there under contract for a set period of time, after all, so a long period of time of unpleasant treatment can be motivation enough to do things you wouldn't normally want to do.)
I was able to avoid the anthrax vaccine around 2000 by refusing to sign a waiver. I ended up getting transferred to a new command shortly thereafter which was scheduled long before this anthrax vaccine situation, but I can't be certain that there were going to be any repercussions regardless of my decision because most of my fellow service members at that time were unwilling to be test subjects as well.