Donald Trump has said Jordan and Egypt should take in Palestinians from war-ravaged Gaza.