Can an oil pressure sensor detect oil pump failure?

An oil pump failure can be detected by an oil pressure sensor. In normal operation, an oil pressure sensor shows the oil system's pressure to be in the 'normal' or middle zone.  If there has been a failure somewhere in the system, then the oil pressure sensor will show no oil pressure at all because the oil pump is no longer moving the liquid along. The result is zero oil pressure, which the oil pressure sensor will certainly show. You can also tell there is an oil pump failure because your oil system is no longer working at all.