Why is that any different to messaging your friend on Facebook and saying the same? Riot doesn't monitor your private messages in client and as long as you are not harrassing or verbally abusing a player then it's alright. It's kind of the same as saying (in client to a friend via messaging) "That bleeping pizza burnt my bleeping hand". You're complaining about something that happened. Are you hurting the pizza's feelings? No, he can't hear you. He's off somewhere else complaining to his friend about you groping him.
IF you're saying it in game or in post game chat etc, then yes you can be punished as you may be affecting other people whilst saying it. Riot assumes that the people you talk to understand you and understand your behaviour. If your friend has enough of your 'toxicity' then he can submit a ticket to Riot and say your being verbally abusive etc or he can block you or whatever.
One last analogy, in case my pizza one made you hungry. It's a bit like being at a bar with your friends. You get annoyed and start screaming at some random dude because he knocked over your drink or the bartender gave you the wrong change. You could get in trouble (kicked off the property, police called). BUT if you wait until your home with your friends or whatever, away from the environment, then you're not actually hurting anyone by complaining.