Hey man, sorry to see that you have to deal with this. I understand how you feel, I had the same swim unit last year, and I was dreading it. I was unable to tell my teacher (I would've failed the class if I didn't swim), and my parents weren't very helpful at the time, so I just did it. I had to just not focus on all my dysphoria at the time, and I wore my board shorts and rash guard. When it came to changing in the locker rooms (worst part) I ran straight for a bathroom stall (I still had to use the girls' one last year). Being in the pool wasnt that bad, but I don't get rashes. We had a guest lifeguard who taught us, and I passed as a guy, even though my chest wasnt flat at all and I wasnt out to the class.
So I think that you should tell your coach, unless you feel unsafe. But as long as you do feel safe, I think it'd be best to tell him/her about how uncomfortable you are, and possibly about your allergies. And if you can't come out to your parents, maybe you can talk to a school counselor or a trusted teacher? I came out to one of my teachers so I could talk about it with someone. So yeah, try talking with your gym teacher, see if you can sort things through. Oh, and try talking to your mom about your dysphoria, if you feel safe.
And if all else fails, swimming wasn't nearly as bad as I thought it'd be last year, even though it's not good for your dysphoria, it was still a good experience, so maybe you'll just have to swim. I wish you luck