Short answer: no. Longer answer has to do with a bunch of factors.

First, after drinking a liter of beer, you are drunk--if not tipsy. You don't have full motor control, which means you can end up hurting yourself or others without intending to. There's a good chance you'll get kicked out of the gym (unless you own it).

Second, alcohol dehydrates you, and to exercise properly you need to be properly hydrated. Dehydration is made worse when you are sweating out what little hydration you have left--there's a good chance you will vomit.

Third, alcohol numbs you to pain. That means if you do something to injure yourself, you won't know it until you really make things worse--or possibly after you are sober again.

Lastly, your friends sound like they just want to laugh at the drunk guy at the gym. Not really a good thing.

Just don't be stupid.