If everyone agrees that the game is over then there's a surrender vote, if your team mates are still trying to win and you go AFK, then that's just you abandoning your team, you can still turn around a game with team mates who are behind, but you'll never win a game by giving up.
A few personal examples of hopeless looking games that turned out to be wins:
0/14 Kled support with no gold item and a 1/8 Yorick jungle on my team, enemy team surrendered because they couldn't deal with me as Nasus
a 70 minute game where the enemy Poppy(pre-rework) kept one shotting me in most of the team fights, Allied Zed managed to back door and beat them at the base race a few seconds before they would have killed out nexus
A bugsplat didn't let me connect for the first 10 minutes of the game, I somehow manage to catch up, get a penta at one point and we go on to win the game
ADC never connects and our trundle support is left 1v2 in bot lane, he holds out and goes full tank, jungler snowballs the other 2 lanes and we win 4v5
Really fed Jayce on the enemy team keeps wrecking us in team fights(This is a personal favorite) start a team fight while he's not with the team and wipe them, we lose 3 people, he shows up to try to kill the rest but I still had Ashe ult, get the penta off of that, it activates the battle for freljord quest since there is an enemy Sej, we push through the enemy team in the next fight off the respawn advantage since they are still staggered, win the freljord quest and I finish the game with an ice crown on top of a pentakill.
Some of the best games of league I've played have been seemingly impossible comebacks, so if your first instinct is to give up every time things seem a little difficult then I feel bad for you because you'll probably never get to experience that sort of game.