Just make an alternate account to hop to and that way you can dodge bad groups/maps as well as any penalties for leaving.
As other people mentioned you can leave at the very beginning during character select without any penalty but it’s a small window.
You don’t get that opportunity when you backfill or if you’re a little late selecting a character.
With a free alternate account, you can swap and play a match while any penalty on your main account is counting down.
Alternatively, soft throwing is a great option if conditions aren’t up to your standards in a match instead of leaving.
Just practice a new hero or your least played hero, or see how long you can go without dying, or just watch the other people on your team play. As long as you look like you’re playing, even if you’re not playing to win, most people won’t notice.
No matter what you do, learning to care less and not let a bad situation affect your mental is key if you choose to continue playing this game.