Can I vent a dryer from the same mechanical closet as a water heater.?
Very likely not.  

The codes around heating and cooling are very specific about the sizing of vent pipes - if the pipe is too small, you'll get back pressure and carbon monoxide issues.  If the pipe is too large, you'll get condensation issues.

Adding another appliance to an existing vent pipe (whether a chimney or a PVC pipe) will almost certainly put it out of code compliance.