Mexico's President Enrique Nieto has had unkind words for Donald Trump in the past. I believe he's even used the Hitler analogy if I'm not mistaken.
So why would he extend an invite to Donald Hitler mere months later?
Because he suspects there's a good chance Trump could be the next President of the United States, that's why. And should that turn out to be the case, he realizes it's way better to lay the groundwork for a good working relationship sooner rather than later.