Not recommended. Water ingress will take place all over the bike. ie. cable housings, bearings, frame, brifter/shifter mechanisms.
If the bike gets really dirty (mtb), best to wash by hand, soap, bucket, light spray from garden hose. Follow up with WD40 to displace water from mechanisms and cables.