The US Supreme Court has been asked to decide whether Donald Trump can be prosecuted for crimes he allegedly committed while he was president.