1. The car runs on gas.

2. The car runs on gas and electricity.

(Are both grammatical? Do we have to use 'on'? Can't we use other prepositions instead of 'on'?)

Both are grammatically correct, yes. And yes, "on" needs to be used.