It's the law that only people legally in the USA can use the exchanges. However, people here illegally can buy their own private insurance not through the exchanges.
Citizens without documents should be able to eventually come up with the citizenship paperwork if they don't have it. Some homeless people might have an issue with that. or not.