That is a complete myth and you are putting yourself at great risk.
If someone said that to you, tell them they are extremely irresponsible. If you got HIV
during unprotected sex
, taking a shower isn't going to wash anything off - it's inside you and already infected you. Eating garlic? How does that work. The best thing is to use protection and know your partner's history before sex.