Yes - often, if you're starting from scratch. But for replacing natural gas (for example in domestic piped domestic heating) or coal (steel production) in the short term, hydrogen may be more cost effective.
To replace natural gas you're probably much better off using that hydrogen along with some CO2 and electricity to produce methane.
They'd probably have to convert it into methane or something for domestic gas heating. It's not really safe to have in houses.
The plan in the UK IIRC is to mix hydrogen (10-20% I think) into the existing mains gas supply to lower the carbon intensity somewhat, in the long term though we're trying to replace boilers with heat pumps for domestic housing.