Aside from the countries where trapping dual citizens is not allowed, an essential part of applying for a visitor visa is that you are closely connected to your home and plan to return after your visit. If you are in a country where you are not a citizen in the long term, the consulate would like to make sure that your situation there is legal and stable and that you can return. If you are in country A without legal status, country B is unlikely to issue you a visa because they reasonably fear that you are likely to land in your country without legal status.
Britain is one such example. In your Evidence Guide: Visits to the UK, they're listed under "Other Documents You May Want to Provide – All Visitors":
Confirmation of legal residence if you are not a national of the country in which you are applying or if your right of residence is not included in your passport
Similarly, France notifies those who need short-term visas and are applying from the United States:
If you are not a US citizen, please submit your legal status (green card, visa and I94 or I20 for holders of an F1 visa or DS2019 for holders of a J1 visa. The signature "Travel Endorsment" is valid for one year and must be valid for one year not expire before the date of return to the U.S.).
France is not there to enforce the U.S. Immigration Law, but it wants to make sure that visitors are likely to leave France at the end of their stay.