UFC fighter Dennis Bermudez tells TMZ Sports ... fellow UFC star Cody Gibson took the "smart approach" by not murdering the guy who punched him in a Vegas bar ... because if Cody would've punched back, he'd be in jail right now.
Bermudez -- ranked #8 in UFC featherweights -- was out in NYC yesterday and told it to us straight ... "If you're an MMA fighter and you get into a street fight and you put hands on the guy ... you're going to jail."
Of course, Cody tackled his assailant to the ground after he was slugged in the grill at point blank range -- but never threw a punch. Eventually, the fight was broken up by security.
Bermudez says he deals with drunk idiots at bars all the time who wanna pick fights with UFC guys to test their manhood ... but says there are tricks to getting out of the situation without a violent ending.