Can you get a student loan with a work permit?

A work permit alone does not guarantee Federal student aid, which are reserved for US citizens, permanent residents, and a few other categories of non-US citizens.  If you have a work permit but are in the country illegally, it is not possible to receive Federal aid at all.  However, Federal Government is not the only entity that provides student aid.  There are other organizations and financial institutions that will give you a loan.  The best path forward is to research the website of the university that you plan to attend and even discuss your case with either the admissions office or the financial assistance office to find out what sort of financing maybe available to you.