Not sure about Nikon's lenses, but some Canon EF lenses are certainly not designed to be manually focused while the lens is in AF mode. If you try, you can feel your hand actuates the AF motor in the lens, and whenever you focus too fast the gears start skipping. That ain't no good for them. It may result in increased wear or even internal mechanics failure.
However, lenses with an ultrasonic motor are designed to be focused in AF mode, and it is absolutely safe to do so.
Regarding Nikon lenses, it will also probably depend on what kind of lens it is. For example, whether it has a screw actuator (hence, no internal motor) or something else.
In any case, please refer to the manual for the lens and your camera body. Some of the instructions may be precautions, but the manual for sure does contain information on how whatever piece of technology was designed to be used.
You are free to use it whichever way you want, and using your lens or your body in a way it was not specifically designed to be used may be safe, but that safety was not intentional. Those pieces are probably not gonna break from these slight mis-uses, they are made qualitative, but no one is going to guarantee that to you, so it is probably better to stick with the best practices, which are coincidentally described in the manual, unless you know what you're doing.