Can I install ubuntu on a brand new computer with all new parts including hard drive? Or must i have Windows or Mac OS installed first before installing ubuntu?
No. You only need a Ubuntu installation CD/DVD/USB to do it. You can run Ubuntu as an OS. You don't need Windows or Mac OS X at all.
No you do not need another OS installed first to install Ubuntu. You just need to boot from the LiveCD or LiveUSB and select Install.
The only thing that you might want to check is the Component catalog of hardware certified to work on Ubuntu to see if all your components will work correctly. A component missing does not necessarily mean that it will not work , it may have not been tested yet. If unsure just Try Ubuntu from the LiveCD/USB to see if it works.
If you have an external graphics card, they can sometimes cause problems, usually these result in a black screen either during boot form the LiveCD or after installation. These can usually be fixed by installing the graphic drivers needed with the Additional Drivers program in Ubuntu. If you get the black screen a great detailed answer on how to fix it is here:
Good instructions to install the drivers that may be needed to fix the graphics after you can boot/install Ubuntu is here: