Yes, it is legal to sell a rental property with tenants in it. However, the rights of tenants vary depending on local laws. Typically, tenants have the right to continue their lease even after the property is sold. Some jurisdictions may require the new owner to honor existing leases until they expire.