My experience in Japan has been that genuine efforts to be polite and respect their culture are deeply appreciated.
That the PM of Canada made an effort to say more than just an occasional arigato is likely seen as a welcome gesture of friendship and respect.
In my experience in general, most locals appreciate when you speak their language as best you can... except France. In France they look down on you as inferior. France isn't over the renaissance when French was the language of leadership and class...