As the image actually shows the outer surface of a drum brake, that can have surface rust on it with no issue, the interior surface however must not be rusty. The other surface that must not be rusty is the surface where the wheel mounts - rust there can mean wheels work loose.
For disc brakes, the hubs can show a surface coating of rust, which is fine. If it becomes pronounced, then the disc can separate from the hub making the brakes useless...
However, The braking surface must not be rusty, a good drive with sufficient braking usually sorts this out, if the rusty surface is only due to a short period of non-use. If the rust is heavy, then the discs should be cleaned or surface ground and measured before being put back into service with new pads.