Well, yes....
and no.
The law of conservation of energy means that energy in must equal energy out in some form or other. Gas is no different it's just an awful lot gets wasted in the exhaust etc. A heat pump isn't generating heat (well, it is, but only a tiny bit due to mechanical action) it's...