My dryer which is located in our garage and our downstairs bathroom vents are connected. When the dryer is running warm air is moving to the outside, but also some of the air is coming back into the bathroom. This leaves our bathroom wet with moisture from the heat unless we turn on the bathroom fan every time the dryer is running. Is there some type of draft blocker which could slide into the vent in the bathroom which would prevent the air from coming in but allow the air out when the bathroom fan is running. The vent in the bathroom is 3" in diameter. I appreciate any feedback. Thank you.
The only good solution here is to run independent duct lines to the exterior, as should've been done initially. It's a violation of codes for good reason, as you've seen. Both ducts should be rigid or semi-rigid pipe, as appropriate.
Backflow preventers aren't the answer, because if multiple fans are running, and one is stronger, the other could be completely blocked. This means that the weaker fan isn't doing its job and may overheat due to lack of cooling airflow.
Your bathroom exhaust fan is probably 50 years old. All bathroom fans from the last 25 years (my cheapest Broan fan) have built-in backdraft dampers. Go to HP and buy a new Panasonic fan rated for 100sqt $150. Be careful with Broans, their fans leave backdraft dampers slightly open, not energy efficiency in the Winter this is not good in your case.