Etymologically, the word ask is derived from the Old English word for "ask". The Old English term had two forms, acsian and ascian, the former being the literary standard until about 1600 when the latter gained the imprimatur of being the high style variant. The /aks/ variant was and still is utilized in several dialects of United Kingdom and is particularly associated with the West Country dialect of England.
In the United States, the /aks/ variant is a particular feature of African American Vernacular English (AAVE). It is possible that /aks/ variant was also the form most commonly used in the dialect of English to which the slaves were originally exposed, and has persisted in AAVE for the same sociolinguistic reasons that other features persist. The /aks/ variable in AAVE is unique in that it is the only example of such a phonetic shift, and thus is unique to the word "ask."
The /aks/ variant is an example of the natural switching of sounds called metathesis. This occurs usually because in the speech sound patterns of that language or dialect that pronunciation may be easier. This is not a degenerate way of speaking. All languages and dialects are linguistically equal as they are all systematic and rule governed.
SFN 2: You mean kill him?
SFN 1: No, dummass, aks him!
SFN 2: What the fuck! I'm not gonna axe him!
SFN 1: Sheeit, you ain't gonna find out where the shit is then!
SFN 2: If I axe him, I sure as fuck won't!
SFN 1: Get the fuck out...I'll aks him!