The 22-year-old pleaded guilty to a charge of sexual assault in January following an incident at a Bawtry bar last year.
He was handed a six-month prison sentence, suspended for two years, and placed on the sex offenders' register for seven years.
Mason’s contract was cancelled by Rovers in March after he withdrew an appeal against his dismissal.
“This could be viewed as a controversial signing given what happened to him earlier this year,” former Rovers boss Ferguson told Peterborough’s official website.
“Obviously the boy has made a massive mistake but I do believe he deserves another chance.
“He has admitted he has made a mistake. He had poor advice from his legal team, which is something he is aware of, but clearly as a club, we feel we can move on from it.
“There were several other clubs in for his services. We have done well to get the deal over the line.
“He is a very versatile player, he was excellent for me at Doncaster and there is no question, that he has the right character.
“He can play in a number of different positions, technically good with both feet and he was Mr Consistent at Doncaster.
“Working with him in the time he did, I am fully aware that what happened involving him is not part of his personality,” he added.
“Niall is not the person that people may view him as from the outside based on that one incident.
“It is important we have a bit of versatility from within the squad, he can play right-back, left-back or as a centre back as part of a three, he can play in midfield and he understands exactly how I want to play. I am looking forward to working with him again.”
Mason, who has signed a two-year deal with Posh, said: “I made a big mistake in my life and the reason for the plea at court was off the back of advice from my legal team, which they really got wrong.
“I am upset about what happened but it is now about trying to move on and looking to the future. I have joined a really good club and I can’t wait to get started.
“I know the manager well, he gave me my debut at Doncaster and I know what he is all about and what he will expect from me.
“I will do all I can to help the team in whatever position the gaffer plays me in. It is down to me to train well and show everyone what I can do.”
Mason, who arrived on loan at Doncaster in 2016 before signing permanently from Aston Villa, was a regular in the team until shortly before his court appearance in January but was suspended by the club following his sentencing.