NO HE CAN'T, I doubt if the case would even get to court, the law both here in the UK, USA and Canada (countries like that), state that children born out of wedlock can take their mothers maiden name. Years ago they could only have their mothers maiden name, but these days you can put the fathers name on the certificate if you want. All the same because your not married, even if you were still with him and he was not your ex, he has no right to the children.
The only thing he can take you to court is for accesses to the child, and that will only be at the most one day a week for a few hours. You have all the rights over your son. It is recognised by the law that young children should be with their mothers they need that nurturing - so don't be scared, I can honestly promise you, he can never take your son away, not can he change what's on the boys birth certificate. Any lawyer or solicitor will tell you that.
Don't worry - honest your ex is just bluffing - again no Lawyer or Solicitor he hires will take on that case because the ex don't stand a chance.
The only thing I can warn you about is that you must make sure your seen as a good mother, go out by all means now and then with friends but don't do it too often. The ex may well try to say your not a fit mother - but again, that's a very hard thing to prove.