Well, yes it canin Gen 4. However, in Generation 5, when a Rotom is in one of its forms, it lses its Ghost type and becomes an Electric/Type that corresponds wih the form it is in. So in Gen 5, Frost Rotom would be an Electric/Ice type, thus making it immune to Hail.