My tankless water heater (80% efficient, with stainless steel style vent) does indeed use a condensate drain in its venting system. This was required to comply with local codes and the follow the installation instructions for my particular unit. There is a “condensate drain tee” fitting which has a small hose nipple on the side, to which a condensate drain system is attached.
The higher efficiency tankless water heaters, e.g., the 95%+ efficiency units, are condensing units and also cool down their exhausts enough to be able to use plastic vent material (such as PVC) will have condensate drains built in to them. I would guess rainwater that falls down into the vent, much like condensate, would safely exit the unit through the condensate drain.
I would recommend reading your water heater installation instructions, and checking with local installation codes to make sure you are installing yours correctly. The instructions and codes may indeed call for condensate drain, which would collect rain water.
I’ve seen elbows installed on the end of some plastic vents - presumably to make it tougher for rain water, birds, or small vermon to get in. Follow whatever the installation instructions and local codes say, and you’ll be fine. No need to reinvent the wheel.