Of course you can do it. Here's a guide: https://theredblacktree.wordpress.com/2014/07/29/installation-guide-for-linux-mint-17-ubuntu-14-04-on-apple-mac-mini-late-2012/
It's for a Mac Mini, but the principle is the same for any Mac. Having said that I would strongly recommend that you stick with a dual boot rather than removing OS X completely.