Well actually you can try; our Health and Safety Executive have a pretty good go but they have missed a glaringly obvious issue!
Here it is against the law to open a lift door and step into the lift shaft without checking the lift is actually there for you step into ……..
Who would do that? And how would making it illegal actually address the problem?
Surely the prospect of plummeting to your certain death or crippling injury, and a nomination for a Darwin Award, should be a big enough dis-incentive without the added worry of a prosecution!