Donald Trump has defended his surprise attack on Iran by comparing it to Pearl Harbor while he sat next to Japan's prime minister.