Hollywood badass Danny Trejo -- aka Machete -- was a real-life ass-kicker behind bars ... telling TMZ Sports he was a champion boxer of every prison he was in ... "and I was in all of 'em."
Trejo's story is legendary ... after going in and out of California prisons growing up, he got a job as a boxing trainer on an Eric Roberts movie ... which launched an incredible movie career of his own.
We got Trejo out in L.A. Wednesday night -- and he told us what it was like to fight in prison ... and it's just as rough as you'd think it would be.
Trejo also raves about Floyd Mayweather -- saying whether you love him or hate him, you have to respect him as one of the ALL-TIME GREATS.
Check out the video ... this dude is pretty awesome.