At least three would-be Republican presidential contenders have said that vaccinating children should sometimes be done on a voluntary basis, but their careful comments on the issue underscore how problematic it could be for some of them in a primary fight.