I bought a new Canon 40mm STM lens and in the Lens Manual it says
The focus cannot be adjusted in manual mode.
Does it mean that its harmful to rotate the focus ring when the focusing mode is set to manual mode?
You need to read the rest of the line. It says
The STM focus is electronically controlled it would appear, thus you can't adjust it without power being applied to the motors. When you turn the ring, it's just telling the camera to make adjustments with the motors. You don't have an actual link to the focus movement.
The lens also supports full time manual, so if you are shooting in "One Shot" mode, then you can manually adjust the focus after focus is achieved automatically.