There certainly do exist sealed combustion water heaters. These are designed to draw their combustion air from the outdoors, burn the gas in chamber sealed from the room, then blow the exhaust back to the outdoors. Your suggestion is to DIY-build exactly this.
Does the existing heater have a traditional draft-type exhaust in which the only force driving it is convection caused by the heat of the exhaust gas, or does it have an inducer fan to blow the exhaust out? If the inducer fan type I can imagine there might be enough air flow to draw in some dirt. But if the heater is the draft type there's no way it has enough air flow to pick up and draw in dirt.
In either case, keep the area around the heater clean. Then the only "dirt" it could draw in would be dust that is suspended in the air -- if there's a great deal of dust suspended in your air evaluate what can be done in the landscape or elsewhere to cut down on airborne dust.
I think it's likely that you're not really seeing dirt at all. Instead it may be sediment that is rusting away from the combustion chamber walls. Apart from routine cleaning I'm not sure there's much to be done about that.