This is indeed a true effect but there is no perfect scientific explanation for why it happens. Certainly it is not true for cold and hot water at all temperatures, but for certain temperatures of hot and cold water, the hot water will indeed freeze faster. The phenomenon is sometimes called the Mpemba effect, named after a Tanzanian student who popularized the effect in the 1960s.
Nobody knows for sure why hot water freezes before cold water. The leading theories include the idea that the hot water evaporates more during the cooling process and the latent heat of vaporization causes cooling and also reduces the volume and hence speeds up freezing. There's also the notion that the hot water has less dissolved gasses and somehow this increases speed of freezing. Finally there's the idea that the hotter container melts any frost at the bottom of the freezer so there is better contact between the container and the fridge offering more heat transfer and faster freezing. There are numerous other hypotheses, but none has ever been tested and proven definitively by experiment. Experimenters who have tried always end up more confused than when they started. For an excellent history and survey of this phenomenon read Philip Ball's account at PhysicsWorld.com.