My parents thought this as well, but it turns out their new gas stove has a safety feature which prevents this. If there's no electricity, a solenoid doesn't engage when you turn the knob, which in turn doesn't allow any gas through to the range.
I'm assuming any modern gas water heater is in a similar boat, with an electric starter instead of a pilot light - and it's much more difficult/annoying to light a water heater than a stove with a match.