You heat the water when you wash dishes by hand too, don't you? It's not very hygenic to do dishes with just cold water.
Given that by hand you use much more hot water than the dishwasher would, you're using more electricity (or gas). Since a little pump doesn't use much at all, it's mainly just the drying heat that matters. Though nobody is forced to use the drying cycle - if one enjoys drying dishes by hand, they can still use the dishwasher to do the washing.
You're assuming an absence of solar hot water heaters - the world isn't homogenous.
eg. Our household conserves water (we track every litre we bring up to the tanks and filter) and we don't have a dishwasher - hot water is heated by the sun and run-off goes to the grey water tank for the garden.
In my house you don't heat the water but it's been sitting in a metal water tank at equitorial latitude for hours so is generally quite warm for evening dishes.
Is it safe? Not for a restaurant where the temps need to get to parasite killing temps to pass muster.. but if I had to guess, the odds of getting killed by a bad-tempered cow outweigh it by 10x.