Of course if you read the info (linked above) it's not only for undocumented people - it's basically for "foreigners" of all sorts
It says these people might have one if not entitled to an SS number
A foreign national legally residing in the United States who, based on number of days in the country, is filing a U.S. tax return.
A foreign national who is a student, professor, or researcher in the United States and is filing a U.S. tax return, but does not qualify to receive a SSN.
A dependent or spouse of a U.S. citizen or lawful permanent resident.
A dependent or spouse of a foreign national on a temporary visa.