Yes you can vent a gas fired water heater out of the wall if it is either a power vent unit.
Venting a gas water heater through wall.
Exhaust gases are vented outdoors through a separate vent duct or through a separate chamber of the same pipe this requires a double wall vent duct.
This water heater is found in different homes.
A water heater using atmospheric venting or direct venting will allow the fumes to exhaust naturally by rising straight up through a vertical vent which is routed to the home s chimney or through an upward sloping vent which may be routed through the chimney or through a wall to the home s exterior.
The direct vent water boiler is another type of water heater venting that you should know.
The only other option is an electric water heater which requires no vent.
Venting a hot water heater through the wall atmospheric water heater.
They do make two models of power vent units one is called a direct vent power vent as bob harper pointed out it draws its combustion air from outside unlike a standard power vent unit which burns its combustion air from the dwelling.
Direct vent water heaters with a direct vent system air for combustion is drawn from a vent pipe that runs through an exterior wall or the roof.
The atmospheric water heater is very common.
The difference is that a power vent water heater pulls in combustion air from the space.