They can refuse, and they have refused. See San Bernardino and the concept of "compelled work".
That was the old US law, not the one where Tim Cook delivered gold bars to Trump
That was the old US law, not the one where Tim Cook delivered gold bars to Trump