All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
We do not know what this Hadeeth is that you are referring to in the question. However, it is established in Islam that a Muslim is obliged to abide by the Law of Allaah regardless of the time or place one finds oneself.
Allaah says (what means): {But no, by your Lord, they will not [truly] believe until they make you, [O Muhammad], judge concerning that over which they dispute among themselves and then find within themselves no discomfort from what you have judged and submit in [full, willing] submission.} [Quran 4:65]
Allaah also says (what means): {And in anything over which you disagree - its ruling is [to be referred] to Allaah. [Say], "That is Allaah, my Lord; upon Him I have relied, and to Him I turn back."} [Quran 42:10]
Therefore, it is not permissible for a Muslim to follow man-made laws under any circumstances or abide by a law that contradicts the Law of Allaah; these are the characteristics of the hypocrites. Allaah says (what means): {Have you not seen those who claim to have believed in what was revealed to you, [O Muhammad], and what was revealed before you? They wish to refer legislation to Taaghoot (false gods), while they were commanded to reject it; and Satan wishes to lead them far astray.} [Quran 4:60]
Therefore, it is not permissible for a Muslim to abide by man-made laws when the Law of Allaah exists; rather, he is obliged to abide by the law of Islam, and if he does not abide by it in this case, he is sinful and it is feared that this will lead him to Kufr (disbelief in Allaah).
It is not permissible to resort to man-made laws except in case of necessity, like when there are no Islamic courts or what serves as a substitute for them, like Islamic Centers in non-Muslim countries.
Finally, it should be mentioned that the divorce that is issued by courts run by man-made laws is not effective if it is not issued by the husband, as stated by the Assembly of Muslim Jurists of America.
Allaah Knows best.