You can query the WEBAPI to get your results. Based on the results you can create a fetchxml and add this to the lookup.
Xrm.Page.getControl("xxx_subregionid").addCustomFilter(fetchXml);
The function which does all this work can be triggered by adding a PreSearch to the lookup.
Xrm.Page.getControl("xxx_subregionid").addPreSearch(filterSubRegionsForCountry);
When you press the lookup the function filterSubRegionsForCountry will be executed in this example.