Convention says no, but theoretically a life or hereditary life peer could become prime minister, as Alec Samuels explains
The tenure of Theresa May as prime minister appears to be uncertain and limited, and she is most unlikely to lead the Conservative Party into the next general election. Could William Hague, or for that matter any hereditary or life peer, become Prime Minister? The answer is theoretically yes, though by convention the Prime Minister sits in the Commons. Disraeli was elevated to the Lords while Prime Minister in 1876. Lord Salisbury was the last Prime Minister in the Lords, retiring from office in 1902. Lord Home emerged as leader of the Conservative Party in 1963, promptly disclaimed his hereditary peerage, secured a seat in the Commons and duly became Prime Minister. Lord Hailsham had indicated his willingness to do the same had he so emerged.
Disclaimer
An hereditary peerage may be disclaimed by a succeeding peer under the Peerage Act 1963 s 1. This legislation was largely due to the efforts of the late Tony Benn, the then second Lord Stansgate, who wished