Ted manages to beat the shit out of John easily, but is torn apart at the end pretty quickly. However, this makes more sense when you examine both scenes: John was inflicting blunt trauma on Ted. As he has no bones, tissue, muscles, internal organs, etc. then there's nothing to damage, and so he won't get hurt. He cuts himself on some glass, however, and his sutffing starts falling out. This is essentially the only thing keeping him from flopping to the floor. That's why rips and tears hurt him, as they're essentially pulling out his bones, not just making him bleed.
In the "Where Are They Now?" Epilogue, it's stated that Donny was arrested for kidnapping Ted, but the charges were dropped "when everyone realized how stupid that sounded". This is played for humor, but it of course makes Donny a Karma Houdini.
Beyond the Karma Houdini factor, it means that the world has now grown accustomed to the existence of a magical sentient teddy bear, but has yet to great said bear any legal protection. Basically, there's no law against anyone doing anything to Ted.
What's to prevent him from trying to kidnap Ted again?
That depends on your interpretation; Ted mentions being an American citizen. What most likely happened is that this defence was used to thoroughly deconstruct and ridicule Donny’s obsession to turn him into a harmless laughingstock.
The charges may have been dropped, but they never said he wasn't put into a mental institution.