The claim is judged unproven. But thinking about Trump wanting to expel legal immigrants, I could not help but think about expelling Musk if it could be proven that he did violate the law (no exceptions).
Snopes.com: Musk Was Once an Undocumented Immigrant in US?
This claim seemed to stem primarily from the 2013 interview during the Milken Institute Global Conference, in which Elon Musk and his brother spoke about their early days as budding entrepreneurs in the U.S. In that interview, Kimbal Musk recalled various venture capitalists they met in 1996 (before Elon graduated from the University of Pennsylvania), saying that "when they [venture capitalists] did fund us, they realized that we were illegal immigrants." Elon Musk laughed and corrected him, saying it was more of a "gray area."