Mr. Musk is the chief executive of electric-car maker Tesla Motors Inc. and rocket company Space Exploration Technologies Corp., and is a close associate of Peter Thiel, the tech investor and entrepreneur that backed Mr. Trump during the campaign.