Can one pay off a mortgage before its maturity date, by selling the real estate to the bank that issued the loan itself?

The mortgage is not just on the house, a mortgage is issued to a specific person. So when a house is sold, the mortgage must be paid off with the buyer's money. The buyer of course probably got that money from a new mortgage. The buyer, the seller and possibly someone from each bank get together a 'closing' and pass the money around. But no you don't sell it to the bank.

Generally, mortgages have no prepayment penalty in the US. Therefore, you can pay a mortgage off early just by making payments that are larger than the minimum payment. You can refinance your mortgage at any time by getting another mortgage as well and using that mortgage to pay off the first one.