The hospital are there to ensure you are both safe for baby's arrival. That includes keeping your Ex out once you have told them he is harrassing you.
Take your friend and make sure she knows that your Ex is not to be allowed in should he turn up. No ifs no buts, not for any reason what-so-ever!
Also absolutely make sure the midwife and hospital staff also know this before hand. As SGB says if you make them aware, and most importantly why (harrasment), they won't allow him in. Staff may change shift though so that's why your friend should be there to make sure this happens.
In the final part of labour you don't need to be worrying about him, let your friend be in charge of that should it arise.
Being on the birth certificate does NOT make him a dad. My ds's birth certificate proves that. And he will get automatic PR to harrass you with in future if he is on the certificate. Really think about it before you agree to it. I would have reconsidered had it been automatic PR back when ds was born.
If he genuinely wants to be a dad to your baby he can get PR later (once he has proved himself). He can also be added to the birth certificate later. So let him do some leg work on this, prove he is genuine and wants to be involved.
And feel free to tell him now that you've changed your mind and don't believe he should be on the birth certificate as he clearly would rather bully and threaten you that actually be a father. Tell him any man who can stress, harass and attempt to blackmail a pregnant woman isn't the kind of role model you want in a father and if he had your baby's best interests, and health, at heart he'd back off now. Leave it at that. Clearly he has no idea of what giving bith involves so you don't want him there.
Write down details of the conversations/phone calls/texts re this so you can remember them in the future should you need too. Date, time, location, who was there, what was said. If he takes you to court in the future you can say you need to see his commitment to being a father as so far all he has done is threaten and bully you to get his own way and not been thinking about the baby at all.
Also how much contact are you having with your Ex? Stop contacting him now about this. If he phones/texts ignore it. If you are contactable then suddenly stop being he may figure out you are at the hospital and turn up.
Re the surname thing - My ds has my surname. I have never had a problem taking him abroad, with school, doctor anything like that. I still get called Mrs Bean, but hey that's far better than being called Mrs Ex!
Your baby will suffer far more heartache with a bullying dad who isn't putting their best intrests first that they will from an absent father. My ds does ask about his dad and it isn't nice having to deal with it. My friend's kids however are thoroughly screwed up by their dad's behaviour and bullying, aggressive methods of getting what he wants :(
Best wishes for the safe arrival of your baby. Let us know when you can how it all goes.