They must refuse to follow unlawful orders. They never get a choice. They always must follow the law. Refusing a lawful order is a crime, and following an unlawful order is a crime. But they never get a choice.
When someone can pardon you of the crime immediately after you do it, it doesn’t really matter much, especially is you are 100% dedicated to the cause.