I was a nail-biter until middle school when I started wearing makeup and jewelry and nail polish on a regular basis. I quit by stopping biting one nail at a time. At first it was all ten, then only 9, etc. I was down to one pinky for a looong time, but I finally stopped. But I was older and doing it for myself. Not sure it's an approach that would work for a little one.
Our daughter is 2 and just started this. I'm not sure what to do about it. At this point, she doesn't think there's anything wrong with it and doesn't understand why we ask her not to do it - it's just another thing to show her independence! :) So I've been trying to ignore it for now. But I don't want it to become a habit either. What if you put gloves on him or something that will make it really obvious to him when he starts to put them in his mouth? Then if its because he's nervous, you can try to find something else to comfort him, and if it's just absent-minded habit, he can be reminded to do something else. Maybe get him a stress ball or silly putty or something to play with in those instances? Not sure if any of those are good ideas. Good luck!