There's plenty of hard evidence on here of hub motors that have corroded internally from water ingress. If anyone claims that hub motors are impervious to wet weather then they are being a bit disingenuous.
Any motor, whether in a hub or mounted externally, will be susceptible to damage from water, grit, dust etc. If you want a good reliable bike that needs minimum maintenance and will cope with bad weather then you need to pay attention to keeping water and dust/grit out whilst still allowing adequate cooling.
One, often overlooked, problem is that motors 'breathe', drawing in cool, damp air when they cool down and driving it back out again when they warm up. Some have suggested that this is one of the biggest causes of hub motor corrosion, which seems to make sense. The same would apply to any other motor equally, though, unless it's very well ventilated.
The approach I've taken with my boat motors (modified RC outrunners) is to replace the bearings with stainless steel ones (not good for high loads, but OK for my application) and seal the motor windings, Hall sensors etc in epoxy. I also coat the magnets and inside of the rotor with epoxy, and add a coat of paint to the magnets (they can corrode quite badly if they get wet). The exposed bits of the shaft are greased, but could be made from ground stainless bar if I was fanatical about preventing corrosion.
It would be harder to prevent a hub motor suffering from water damage, especially one with gears. It is quite easy to improve the waterproofing of a direct drive hub motor though, just by spraying the stator with silicone conformal coating and then heat curing it. This will do a very good job of keeping the elements at bay, although water damage to the bearings is still a possibility.
Jeremy