If your electricity comes from natural gas, it would be more efficient to burn the gas on-site for heat than to burn it to generate electricity, distribute the electricity, and then turn it back to heat.
However, consider the greater performance scales with generators combined with the amount of useful heat that one gets out of a heat pump can be better than converting the natural gas to heat locally - even with losses on the grid.
The key is that a heat pump doesn't convert electricity to heat (as a resistive heater) but rather moves heat from one spot (outside) to inside with great efficiency.