I'm presuming from your posting the question, that there was no major abuse / deceit etc, which would make 'friends' that much more difficult.
Yes, ex's can be friends, but it doesn't necessarily mean you 2 can be friends - it will take something, and only you know if you've both got it!
Consider thinking of it like this. You have a child together so there is a good reason to experience a shared love - you have an exciting project to take care of! Now - as we know, most split couples end up hating each other, screwing each other over etc. So take it on as a challenge - almost a game. If you can, agree with your ex that you should both be relentlessly decent with each other, supportive etc. So that you can both share your fears / weaknesses knowing that the other wont use that against you, but help you to become a better / happier person - therefore a better / more present parent.
Of course, at times you wont see eye to eye, but you are under less pressure now - you don't live together so should be able to tolerate each other better!
Don't use the kid/s as weapons, or get them to side with you; and don't use money as a power game and you gotta good chance.
Remeber - just treat it as an exercise - that you both engage in - to do really well at. Think how good it would feel to talk about him in a couple of years time and be able to say - yeah, he's been great, he's such a good dad; been a real friend to me etc - up against the usual bore - bastard never blah blah blah...
good luck x
(And yes , I do have this with my ex. We have a 9yo dd and are good friends)