The Bankruptcy Code has specific code sections that list the requirements to be eligible to file a Bankruptcy case. What is not included in the list of requirements is that the individual is a United States Citizen, or even in the country legally. Generally, if you have a residence or business in the United States, and have debt, you can file a Bankruptcy case here. While even illegal (unlawful/undocumented) residents can file a Bankruptcy case, keep in mind that the filing of a petition and popping up in the government computers may trigger an enforcement action or or negative consequences related to your immigration status.
Further Reading: Bankruptcy Code Section 109 – Who May Be A Debtor.