Yes, it is legal. The big issue is putting together a contract to protect you and your domain. Depending on the quality of the domain(s) you should seriously consider consulting with an attorney/barrister/legal counsel that specializes in such things.
By the way, the Search function at the top of the page is your friend. Search for "lease" or "leasing" to see what kind of useful info you can find.
Google is also your friend. I remember searching/finding info about leasing domains a few years ago.
(Disclaimer - I am NOT an attorney and I am NOT giving legal advice! )