Your question isn't very clear, would you mind clarifying?
Unless a service is running on a port nmap wont show it as open. In Ubuntu as far as I know the default policy for iptables is ACCEPT, so if you start up a service running on X port it will be put through the firewall without any issues. So those ports arent really "closed" in the sense that they are blocked, its just that there is nothing there to listen for anything on them.
That being said If you want to explicitly open a port you can open it with iptables
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -I INPUT -p udp --dport 53 -j ACCEPT
You can change the -p to a different protocol, and the --dport to a different port number. iptables has a whole bunch of other options that you can look into. The -j ACCEPT can be changed to DROP or REJECT if you want to block them.