Originally beverages were carbonated via fermentation, which produces CO2 as the yeast. Some beverages still are done this way, such as beer. CO2 is still used because it’s cheap and adds the acidic flavour. Some of the CO2 in the drink forms carbonic acid.
Air couldn’t be used because it contains oxygen, which will allow for the beverage to spoil. Other gases can be used though. Guinness beer for example uses a mix of CO2 and nitrogen, giving it a more foamy head.
In general, for a gas to be used for “carbonation”, it would need to:
* not cause the food to spoil (which is pretty much just oxygen)
* not cause some sort of undesirable chemical reaction with the beverage. CO2 will make some carbonic acid which is fine, but others may make more of worse chemicals.
* not have any negative odour or taste. You wouldn’t want sulfur based gases that smell like rotten eggs.
* they would obviously need to readily dissolve in water. Helium for example would probably work fine, if you could actually get it to dissolve as well as CO2.
* not be flammable would be nice too, as even if methane (aka natural gas) or hydrogen could work, they would also be a little dangerous.
* Also in the extreme, you wouldn’t want it being poisonous. We add a little chlorine to water to kill bacteria, but you wouldn’t want a rupture of chlorine coming out of a beverage or it will kill you. Lots of other toxic gases you wouldn’t want in there.
* Again in the extreme end, you wouldn’t want the gas to be a environmental issue. Something like SF6 may very well work, but you wouldn’t exactly want a lot of that getting into the atmosphere.
A lot of gases wouldn’t work for one of these reasons or another. I’m sure there’s some other gas out there other than CO2 and to a lesser extent N2, they however most likely wouldn’t be as cheap and easy.