Question: how can an illegal immigrant get a tax id number?
Answer: Applicants must fill out a W-7 application form and submit it to the IRS along with a completed tax return. ... 
Applicants are required to submit original documents verifying identity and “foreign status.” The IRS has issued a list of 13 documents that will be accepted for this purpose.