In the US, banks issue mortgages to illegal immigrants all the time. Last fall, the Biden Administration went as far as threatening banks who had refused.
> “This guidance reminds lenders that denying someone access to credit based solely on their actual or perceived immigrant status may violate federal law.”