US President Donald Trump has compared French far-right leader Marine Le Pen's conviction to his legal battles in the United States.