Why doesn't a mercury thermometer follow the rules of volume dilatation? let's consider a classic mercury thermometer.

I do not understand why it does not behave like a "normal" thermometer which exploits volume dilatation. In a normal thermometer, I'd say that the mercury length would be proportional to its temperature.
Therefore, I should be able to measure, for instance, 37 of body temperature, also starting with the thermometer at 38: there would be a contraction, but the measure would be correct! Why does this not happen? And why if I measure for instance, 38, and I try to cool the thermometer by putting it inside cold water, it does not become cooler? Why should I cool it by shaking it?
It seems a very not ideal thermometer... but what are the causes of these non-idealities?
 A: I think you are speaking of a clinical thermometer which records the maximum temperature it reaches. The thermometer has a narrow kink in the bore near the bulb that causes the mercury thread to break at that point when the volume of mercury in the bulb shrinks (the image you've posted actually shows that). As a consequence  the top of the thread does not retract from the high-point reading. (One might worry about the mercury above that break-point shrinking, but there is very little mercury  in the thread, most of it is in the bulb. Consequently  there is little effect from the volume of the thin thread getting smaller.)
The reason that the thermometer is designed this way is  so that the doctor or nurse can take their time in reading the thermometer --- which would otherwise begin to read lower temperatures as soon at it is removed from the patients mouth, or wherever.
Shaking the thermometer after it has coooled to room temperature  causes the mercury in the broken thread to reconnect with the mercury in the bulb, and allow it to be used again.
A: That's because it's a maximum thermometer, which works by pushing the liquid past a restriction in the tube, preventing the liquid from returning into the reservoir upon cooling. If you look closely, you might see the separation in the liquid column between the restriction and the reservoir, which may be bigger or smaller depending on the model.
You don't cool the thermometer down by shaking it - you push the liquid back to the reservoir with an additional force coming from accelerated motion.
As a side note, thermometers which have a secondary reservoir (such as in your picture) are often calibrated to provide accurate reading at room temperature. Reading them while they are still hot gives you a falsely high value.
