Do you mean the mortgage on the rental property that you are selling, or the mortgage on your own house?
Normally, when someone sells a piece of real property, the existing loans are paid off out of the sale proceeds, before the owner gets a dime. Occasionally, a lender will allow the buyer to assume the loan, which remains in place with a new borrower substituted for (or added to) the original borrower. I think such loan assumptions have become less common lately, at least in part because interest rates on new loans have dropped so low.
So, one possible answer to your question is not only can you, but also, you probably MUST pay off your loan ---- if we're talking about a loan on the property being sold.
If, on the other hand, you mean a loan on some other property, such as your principal residence, the answer would have to be "it depends." Among the things it depends upon is how much cash you get from the sale vs. how big your outstanding balance is.