The initial drop in the level of mercury occurs because the bulb of the thermometer expands slightly due to the heat from the hot water. This expansion of the bulb pushes some of the mercury up into the capillary tube, causing the level to temporarily drop.
As the heat continues to transfer from the hot water to the mercury, the mercury itself also begins to expand. This expansion overcomes the initial drop and causes the mercury level to rise. The mercury expands due to its high coefficient of expansion, which means it expands more than the glass bulb of the thermometer when subjected to heat.
It's important to note that the rise in the mercury level is not immediate because heat takes some time to transfer from the water to the mercury. This delay between the expansion of the bulb and the expansion of the mercury is why there is a temporary drop in the mercury level before it starts to rise.