Trump’s comments came after a group of Democrats urged US service members to refuse unlawful commands.