mid-14c., hogge, but probably in Old English (implied late 12c. in hogaster), "a swine," especially a castrated male, "swine reared for slaughter" (usually about a year old), also used by stockmen for "young sheep before the first shearing" (early 14c.) and for "horse older than one year," suggesting the original sense had to do with age, not type of animal. Possibility of British Celtic origin [Watkins, etc.] is regarded by OED as "improbable."
Extended to the wild boar by late 15c. As a term of opprobrium for a greedy or gluttonous person, c. 1400. Meaning "Harley-Davidson motorcycle" is attested from 1967. Road hog is attested from 1886, hence hog "rude person heedless of the convenience or safety of others" (1906). To go hog-wild is American English from 1904. Hog in armor "awkward or clumsy person in ill-fitting attire" is from 1650s (later used of the armadillo).
Phrase to go the whole hog (1828, American English) is sometimes said to be from the butcher shop option of buying the whole slaughtered animal (at a discount) rather than just the choice bits. But it is perhaps rather from the allegorical story (recorded in English from 1779) of Muslim sophists, forbidden by their faith from eating a certain unnamed part of the hog, who debated which part was intended and in the end managed to exempt the whole of it from the prohibition.
Had he the sinful part express'd,
They might, with safety, eat the rest.
But for one piece, they thought it hard,
From the whole hog to be debarr'd
And set their wits to work, to find
What joint the prophet had in mind.
[Cowper, "The Love of the World Reproved"]