My wife hold a Lebanese passport with a valid visa to USA and Schengen.
Coming from Mexico she must layover in London for 24hrs on her way to Beirut, is it allowed for her to stay 24hrs ?
Check on the official UK government website:
From a quick look at the official website it seems that, as a Lebanese citizen, your wife will need a visa to transit the UK whether she enters the country or stays airside.
If she wants to enter the UK (e.g because she must collect her checked bags) it seems that none of the potential exemptions for entry will apply and she will need to apply for a Visitor in Transit visa before starting her journey. Note that none of the exemptions listed guarantee entry: that decision will be made by the border officers who deal with your wife on the day. There are no guarantees.
If she stays airside (that is, inside security) for the whole period she will need a Direct Airside Transit Visa. There are some exemptions which might apply but,again, the decision about her entry will be made by the border officers who deal with her on the day. There are no guarantees..
Unless your wife is certain that she fully meets the entry requirements I would strongly urge her to get either a DATV or a Visitor in Transit visa before she begins her journey (or to fly via a different route).