Does car heater use gas to generate heat?

Not sure just which useage of gas the op has in mind.
As others have said , the heater is not a gasoline powered unit in any way…it’s hot water aka coolant.
or –
Does it use ‘‘additional’’ gas to run it ?.
NO, never has, the coolant just flows the same.
These days , most vehicles do not even have a shutoff valve at all. The coolant is in continual flow through the heater core and NO energy difference occurs …NONE …with the heater on or off.
It’s just a flapper door that closes off , or opens, the air flow.

( unlike the air conditioning which draws energy when in use. The added resistance of the belt driven compressor causes the engine the need to use a tad more gas. )