"Being in a situation like that and having nothing else - certainly I made a lot of terrible mistakes and I paid for those mistakes dearly."
Wahlberg said people often thought of time behind bars as a badge of honour but insisted "having been in that situation, it's not".
The Departed star recalled how he could only get out of the situation was to "actually change" his circumstances.
He added: "I did the work. I took it upon myself to own up to my mistakes and go against the grain and not be a part of the gang any more - to say that I was going to go and do my own thing. Which made it 10 times more difficult to walk from my home to the train station, to go to school, to go to work."
And Wahlberg others in his position can get a "second chance" if they want to change.
He told Observer magazine: "I prided myself on doing the right thing and turning my life around. Whether I found myself venturing off into Hollywood and a music career, or working a 9-to-5 job as a construction worker, whatever path I was going to take, I was going to do the right thing.
"So I think no, judging a person on what he's doing and where he's coming from and all those things, no, I would hope that people would be able to get a second chance in life.
But the Fighter star - who has four children with wife Rhea Durham - thinks his experiences have made his work more "authentic".
He said: "I do think the one thing I have to my advantage is that I have all this real life experience that I can apply to my work.
"I think audiences can definitely sense authenticity. But that came with a real price."