In the United States, paying taxes is an obligation for anyone who generates income in the country. Even if it’s about undocumented immigrants.
This payment should be seen as an investment by the migrants. Being up to date with all tax obligations can work in your favor as part of an eventual immigration regularization process.
Undocumented immigrants who qualify for a refund
Immigrants who a show a significant amount of taxes deducted from their wages during a year can apply for this benefit. As well as those who have dependents in their care.
This is not automatic. The tax authorities analyze each case individually before adopting a resolution.
You can read more at this link.