Install ubuntu on mac with no OS

Can you boot from a pendrive? You will need to make a bootable ubuntu pendrive to install it. Then, according to this link
How to boot a Mac from USB media


You could boot from it and star you journey.

Good Luck.