Purely based on observation, I'd say it goes both ways. I have a buddy who had shoulder surgery for a torn labrum, and he'll tell you it's never been the same ever again, and he's done the rehab, TENS unit, all kinds of stuff, the flexibility just never came back.
On the other hand, I trained with a guy who had to have knee surgery for a torn ACL, and he swears it's better now that it was before he injured it. Now, I don't know how long he may have been dealing with a low grade injury before needing surgery, but that's a pretty testimonial to say it's better than it was before the injury. I think a lot of it just comes down to how well you heal and how invasive the surgery is.