You certainly can obtain a mortgage on a commercial building. However, bear in mind that you may end up paying a higher rate.