I was told that this was possible. Basically this guy said a kid was revving his motorcycle after he turned it off and said it would harm the engine
I am assuming by revving the engine while it isn't running you mean exercising the throttle with the engine off.
You aren't going to cause any issues on a modern fuel injected engine by twisting the throttle on a motorcycle or pushing the accelerator pedal down while the engine isn't running. This is because the engine is computer controlled, the throttle position is just a sensor input, the computer decides how much fuel to inject into the cylinders, and it won't inject any if the engine isn't running.
A carbureted engine works differently, but it is still not likely to damage anything. Most carbs have what's called an accelerator pump which delivers a shot of fuel into the carb when the throttle is applied quickly, this is to keep the engine from stalling from a quick power application. Repeatedly applying full throttle quickly with the engine off can flood your carburetor and make your engine hard to start. In extreme cases this could cause hydrolock, where liquid prevents the movement of the pistons, but it's hard to imagine getting there by pumping the throttle a few times.
As mentioned in comments, in most carbureted car engines there is a fuel pump which maintains fuel pressure then the engine is running. With the engine off pumping the accelerator will use up the residual fuel pressure. Most motorcycles are gravity fed so ifthe stockcock is on you can keep twisting the throttle and the fuel will still jet.