Check the status of linux (and hence, Ubuntu) on MacBooks here
Make note of what doesn't work and whether you're fine with that not working when using Ubuntu.
Currently the Wifi driver doesn't work for most models and so you will need either an Ethernet connection or a USB Wifi adapter to use the internet when using Ubuntu.
Also, as the internal keyboard and trackpad don't work out of the box, you will need an external keyboard and mouse to install Ubuntu and run the commands which result in the internal keyboard and mouse being usable.