In my state (IN) a birth certificate or passport in addition to an out of state license are required. I believe they will accept a green card, but note such on the license.
That's how it works in the two states I live, OH & FL (I think FL). But, from what I understand, there are several states that issue DLs to illegals.
Also, residency is not necessarily a requirement for obtaining a SS card. There are some situations where someone in the country illegally could be in legal possession of a SSN. I have been told that these cars look different than normal cards. But, I don't know independently, if this is accurate.