You certainly can do this, but your annual cost of operation is likely to jump considerably. Cannot say for sure without knowing your utility rates, but it would be rare that a gas WH was not less expensive to run than an electric one. Second, a typical NG fueled WH recovers MUCH faster than the typical electric, so for the same overall performance, you may need a bigger WH, which typically also has bigger standby losses. The cost to do this is too hard to WAG, as the distance from the panel, how hard it would be to run the new cable, and even if there is space and capacity in the existing panel would need to be known, and often, you'd have to be there.