My uncle did this, I've heard him talk about it, but obviously don't have the full details. Sounds like he was able to do this and sock away a huge amount (at least a couple million) into a pension plan, which he then converted into a IRA once he stopped being able to contribute and dissolved the plan.
But, sounds like it was a huge hassle and expense too. He had to pay an actuary to sign off on the plan and what he could contribute to it, had to keep very detailed records, and I think at some point he was worried he was going to end up with too much money due to investment returns and pay a penalty...
He still thinks he came out ahead, and probably slightly more so now that he RMD age has been raised, but it definitely wasn't simple.