According to this link, hauen used to mean "hurry" or "run" at some point in addition to "beat", probably originating from "beating a horse to make it run faster". "Ab" is a Latin prefix meaning "away from."
So "abhauen" just means "run away".
I don't think it's rude because of its etymology, but because there are very few polite ways to tell someone to go away in general, because a) you're telling someone what to do, and b) you're telling them "I don't want you here." That's going to come across as impolite pretty much regardless of what words you use.
I don't think "Hau ab!" is any more impolite than "Go away!" "F**k off!" is stronger than that, and a better German equivalent would be "Verpiss dich!"