If you play with a train that is PF-motorized by hand, will you damage the motor? Or any of the other parts (IR Receiver, Battery box)?
It is essentially working as a generator when turned by hand, so will that current damage it?
Unless you do extreme things it should be fine. All the gears insides the Train motors, Power Function motors and the NXT motors are made of Nylon while the pinion attached to the motor is made of metal.
Since Nylon is much stronger than ABS plastic (normal LEGO plastic), the ABS would twist, tear or brake before damaging the nylon gears.
In fact one of the activities in the NXT manual (page 34) is to manually spin the motor by attaching a wheel to it and rolling it like a paint roller. LEGO seems to trust that it is made to survive that kind of usage.
As for the electricity generated by rolling the motor, I'm pretty sure that the NXT brick is protected for that (given that LEGO expects this kind of manipulation). On the other hand I would not connect a sensor directly to a motor and do this. I would assume that the trains components are also protected since it is very likely that kids would roll the train by hand.
What you are describing is called backdriving. I teach my students, in principle, not to backdrive the output shaft of a gearbox, motor/gearbox, or servo/gearbox unless they know what's inside of it because you can damage the unit. I use a variety of different robots in my class so what I'm explaining applies to gear drives in general.
If you grasp the orange output shaft on an NXT motor (servo/gearbox) and rotate it, it rotates quite easily. You can tell it's going to rotate as soon as a small force is exerted. The NXT motor is really a servomotor and gearbox combination and the geartrain is inside the housing. I know from experience that Lego allows you to backdrive the NXT motor.
Read the following thoroughly before trying - if you break anything, it's your fault!
Backdrive Experiment: Build a drive axle extension that is attached to the drive end of an NXT motor so that you can add some gear reduction. Place an axle through the orange output shaft and then slide an 8 tooth gear onto the axle. Now, mount an axle with a 40 tooth gear onto the extension you've built. You want the 8 tooth gear to drive the 40 tooth gear. A good design will support both sides of the axles and gears.
Make sure the gear alignment and mesh are correct. The gear ratio of this combination is 40/8 or 5:1. You multiply this gear ratio, times the gear ratio of the NXT Motor (servo/gearbox) to get the final drive ratio.
Careful here, you can break something!
Now, apply force incrementally and try to rotate the 40 tooth gear or a small wheel attached to its axle. You won’t' break the gears inside the NXT motor, but you may damage the motor housing, gears, axles, and structure parts. Depending on how well you built the drive axle extension and whether you try to rotate the axle/wheel or 40 tooth gear, you will have surprising results if you have never done this before.
Additionally, some robot gearboxes have worm gears which prevent backdriving by design. Trying to backdrive a gearbox with worm gears will break it. The worm gearbox is useful in a robotic arm so that when power is not applied to the motor, the arm won't fall down. The OWI 535 Robotic Arm Edge uses worm gears and regular gears in its motor/gearboxes. Clutches are used in each motor/gearbox to prevent overload or backdriving that will break the gears.
If you need a picture of how to design the drive axle extension and geartrain, let me know.