Of course you can. It just means that someone else is willing to lend you the money needed to pay off the first loan. When the original lender is paid off, they’re out of the picture, and now you owe money to the second (refinance) lender, under new terms. Keep in mind, however, the following subtleties:
1. Often the qualification requirements are a bit stricter. For example, while the original lender may have been willing to lend you 80% of the value of the house, the refinance lender may only be willing to lend you 75%. Or may require a higher credit score.
2. Original loans (aka, purchase money loans) are usually non-recourse loans, whereas refinanced loans are usually recourse loans. This may be important to you. If you haven’t heard these terms before, google them.