If you compare the definitions in say a dictionary[1][2][3], they have high overlap, but are not the same.
Phrases illegal law and illegitimate law have different meanings. While the first seems an oxymoron and the second may be, both seem to be legitimate descriptions of objects in existence.
Ok, my bad, I was not aware that legitimate could actually be synonymous with legal. In my native language, legitimate globally means that it is the general consensus in society, something that ideally the law tries to capture but it is actually importantly distinct from legal and is never used in replacement of it.
Phrases illegal law and illegitimate law have different meanings. While the first seems an oxymoron and the second may be, both seem to be legitimate descriptions of objects in existence.
[1] https://www.merriam-webster.com/dictionary/legitimate
[2] https://www.merriam-webster.com/dictionary/legal
[3] https://www.merriam-webster.com/dictionary/illegitimate