Can I run a grounding from an outlet next to a 3 prong outlet to convert it to a 4 prong outlet for un electric cloth dryer?
You can retrofit just the ground. However you need to run the ground in #10 wire either back to the panel, back to somewhere that has a #10 ground coming out of that panel (e.g. a water heater), or to metallic conduit coming out of that panel. A #12 ground path is not adequate.
You may also not use water pipes, since they might be part of the grounding electrode system, but they are not part of the equipment safety grounding system.
There is a legal exception that allows you to not ground a dryer. However the exception tells you to bootleg ground off of neutral - exactly what they tell you not to do anywhere else, and for good reason. Any flaw in the neutral wire will result in the dryer's chassis becoming electrified at 120V.