I think modewrn cars have oil level sensors in the sump, but as said above. In something a bit older or more basic, the 'oil light' on the dash is a low pressure warning. Typically if that comes on your engine is already goosed.If it flickers on and off then it could be the oil sloshing away from the pick up due to cornering or braking or something.
If that's the case though then it needs topping up urgently because the engine won't last long if the low oil pressure is sustained.
Thats what *most* oil fault indications are these days. Probably over 95%.
Slightly low oil level, getting either frothy or pulled away from the pump pick up. Then gives you a oil fault light.
And AFAIK, the low oil level sensors will be on some mid/high end cars over the last 8-10 years. A couple of manufacturers that i know of have added one, then taken it away due to reliability issues, then put it back in on a subsequent model year.
FWIW, a well engineered engine *should* be tolerant to an oil level slightly below the bottom limit. The margin is down to the individual manufacturer/model. Some of them are very bad at it. (I've heard of several dipstick recalls/service fixes, so they can fit a shorter one when the oil level was miscalculated!)