NFPA 31 4.3.1 says you must offer the install drawings to the Authority Having Jurisdiction (AHJ) prior to install. 4.3.5..."not be installed or located in areas where combustible dusts,or flammable liquids, gases or vapors are normally present" If you chose to wall it off you then have combustion air/ventilation issues to deal with.
I quickly scanned the rest of 31 and found no specifics for a garage. The 18" is prudent however, if you can do it. So are the crash bars.
Garage fires are the cause of gas fired waterheaters being re-designed several years ago. Some meathead would fill the lawn mower and then slide the gas can across the floor like he was bowling, hit the water heater with the can, the house burns down and it is everyone elses fault but his own. Go figure!