I would argue that it is. There are plenty of cases where laws are unjust and should be broken. Here's an example:
https://en.wikipedia.org/wiki/Blasphemy_law_in_Iran
>Persecuted individuals are subject to surveillance by the "religious police," harassment, prolonged detention, mistreatment, torture, and execution.