Can an immigrant obtain legal residency by marrying a lifer without parole in a US prison?

No. An incarcerated person could not sponsor a foreign national for permanent residency nor citizenship. FYI, marrying a US citizen does not automatically confer permanent resident or citizenship status on a foreign national. Likewise, an illegal immigrant is not eligible for permanent residency regardless of his or her marital status. Unlawfully present individuals are required to voluntarily leave the US and return to their country of origin or face detainment and deportation.