There are a couple exceptions according to US FAA rules...
One example is an IFR safety pilot. If a qualified pilot is using a hood to get simulated instrument time, he must have a qualified safety pilot. Since the pilot is required in that case, the safety pilot can log second-pilot time.