Yes, you can still get a mortgage if your business has made a loss. A lot of mainstream lenders might turn you down, but it’s not impossible.
Specialist lenders are in a better position to understand the specific circumstances surrounding the losses and might consider approving a mortgage based on an individual scenario.  Especially if the losses weren’t in the last two years. Or they can easily be explained. Make an enquiry to find out your options.