If you are in the United States with a visa that allows for work, but you lose your salaried job, it might be possible to receive unemployment benefits from your state. However, that depends first on whether you have some separate right to remain in the United States. Let's look at that issue first, then at whether receiving benefits will lead to further problems with gaining U.S. approval of future visas or green cards as a potential "public charge."
For some non-citizens living in the U.S., the right to work is simply a side benefit of another status.
For example, the spouse of a U.S. citizen who has applied for adjustment of status and is awaiting green-card approval has a right to work in the U.S. (after applying to U.S. Citizenship and Immigration Services or USCIS for an employment authorization document). If that person loses a job, staying in the U.S. and receiving unemployment benefits remains a possibility.
Similarly, the spouse of an H-1B visa holder is in H-4 status in the U.S., which currently allows work authorization (again, after applying for a permit). As long as the H-1B visa holder keeps his or her job and stays in lawful immigration status, the H-4 visa holder can remain in the U.S. after losing a job, and might rightfully receive unemployment benefits.
However, many non-citizens are in the U.S. with visas that depend directly on a job. H-1B visas are an example. For no fault of their own in this tough time for businesses, their petitioning employer could close down or start layoffs. A nonimmigrant visa holder who no longer works for the petitioning employer is also no longer in lawful status, and must either leave the United States or act quickly to find another employer or status. (For more, see Just Got Laid Off From H-1B Job—Do I Have Any Grace Period or Can I Get Another Visa to Jobhunt?.)
For some, but not all non-citizens who wish to apply for some future visa or status in the U.S., in particular for lawful permanent residence, the hurdles to be cleared include proving that one is not inadmissible as a likely "public charge."
In plainer English, that means showing that your finances aren't in a precarious enough condition that you might end up receiving "welfare" or government assistance.
Fortunately, unemployment insurance is not among the government's list of benefit types that make someone a likely potential public charge. (See Which Public Benefit Programs Can Make Immigrant Inadmissible.)
If you end up needing more types of assistance than unemployment insurance coverage, however, the issue could get more complex. USCIS has, fortunately, stated that people with symptoms (fever, cough, shortness of breath) should "seek necessary medical treatment or preventive services" and that this "will not negatively affect" an eventual public charge analysis. But its statement didn't cover more than medical treatment.
That's part of the reason why, in July 2020 a Manhattan federal court issued two nationwide injunctions blocking the latest version of the public rules at least temporarily, during the period that the COVID-19 pandemic is considered a national health emergency. The injunctions were issued against both the Department of Homeland Security (DHS) and the Department of State, each of which have written their own, slightly differing regulations concerning the definition of a public charge. The court's injunction will prevent these agencies from enforcing, applying, implementing, or treating as effective the “public charge” rule during the COVID-19 outbreak.
If you do end up relying on additional government benefits, then when the time comes to apply for a future visa or green card, you would be wise to attach a letter of explanation to your application detailing how the COVID-19 pandemic affected your ability to work or conduct your usual activities and why you had to seek this form of assistance.