It really depends on several things. The charter of the Wisconsin bank of course is one item to consider. If the community bank is near the state line, the service area may straddle the border. And the bank probably needs to be licensed to do business in Illinois, too. That can be pretty easy to verify from both the bank and the Illinois banking department.
If you live quite a distance from the Wisconsin bank, you may be deemed to be out of the general service area and the bank may not consider your loan request. Much of this has to do with the Community Reinvestment Act. The nuts and bolts of the act is to be sure that banks are re-investing deposited funds in the general geographic areas in the form of loans. That is in place to make sure a bank is not only seeking funds from area citizens, but also providing funds to them.
On the banking side, if you are some distance from the bank that you are seeking a mortgage loan from, it could raise suspicions as to why you are seeking them out for your mortgage needs.