Yes they are designed to start, run & produce electrical output even in the rain. However, it gave me a bit of "the willies" to walk up to a generator & be standing in a puddle next to a running generator on its metal skid sitting in a puddle with everything soaking wet even though it was properly grounded. Before I even start my gensets I always review all my ground connections making sure they are solid tight!
The other side of the coin is that after you turn a wet genset off after the storm/power outage is over it just sits there in the rain cooling off with water condensing inside genhead, engine cowlings/cylinder fins & anywhere else rain/snow can migrate to. Over time that can take a toll creating rust & corrosion and can result in problems down the road. So at a very minimum it should be tarped preferably while still warm so it can trap some heat and dry out under a dry tarp.
Though long term longevity doesn't seem to be as much of a problem with generators deployed in military theater. The military typically had the expertise, spare parts and even spare generators on hand to fix or replace problematic gensets. Also, gensets after so many hours on the hobbs would be eligible for a reset - Tier 1 or Tier 2.
Since I don't have the luxury of the military's parts & service depots I like to keep my gensets as dry as possible & well maintained. All my generators are up off ground on their military trailers with OEM covers while running rain or shine. I do monthly runs to test functionality and to heat them up to dissipate any moisture with the quarterly run being a full load test run. So far...they seem like they will outlast me!
You don't really have to have up on trailer necessarily, you can put them up off the ground just a few inches on wooden 4x4's etc. or anything else that will support the weight & allow airflow so they don't sit in direct contact with wet ground. Lots of people either gravel an area, pour cement pads or use those thick paver squares to provide a raised base. Its also fairly easy to construct a shed roof over top to keep rain snow off genset & yourself. If you do a search here on "MEP-002a MEP-003a enclosure shed" you should find some generator enclosures as nice examples to go-by.