Actually, laws can be deemed "illegal", if they violate human rights.
It's how we are enabled to prosecute war criminals and the like who create bad law to facilitate human rights violations.
We don't go after them for the laws...we go after them for their actions. They don't, therefore, deem the laws illegal. They deem the actions (albeit allowed by the laws) as violations of human rights.