The accuracy of a tank gauge is usually very good, but it depends on many things. For starters, when the sender is installed, it is common to bend the float arm to give the proper range inside a particular tank. Since this is usually done by hand, using only an eye as a calibration tool, the results can vary. Also, senders can suffer from corrosion as time goes by & loose accuracy.
I constantly monitor the tank gauges when I fill the tanks on any boat, to see if the liquid that I put in matches with the change that I see on the gauge. If something looks funny, I immediately plan a time to take a look.
Back when I flew planes, we never trusted fuel gauges. We always checked the wing tanks visually with a stick before taking off. If I plan to take a boat out past VHF range, I continue with this old habit of not trusting the gauge.
The only gauge that I really trust is a sight glass. Sadly, that is not a viable option on most boats. Carrying a 5-gallon can of back up fuel is an option that often gives me comfort. In the case of a diesel, you will want to know how to bleed air out of the fuel system in case you do run it dry & need to reach for your can of back up fuel.
Gauges usually work very well, until the day that they don't.