Exactly how the pronunciations have been determined has always been a mystery to me. I don’t think that anyone alive today was part of the decision making.
But it looks to me as if it happened this way. There are three main forms of the verb going back to the medieval era (see the OED forms for ask, v.) There are two forms from OE, ascian and axian (achsian in the OED) and one in ME aische. The OED indicates the ascian form developed into the modern ask. It’s probably not that clean, with metathesis over the years mixing the forms, a lot of swapping back and forth.
As for the actual OE pronunciation, it’s not beyond the realm of possiblity that the <c> in ascian was pronounced /tʃ/ rather than the standard claim that it was/k/, leading to a consistent rule without the pesky exception for this word. But there is a consistent chain of spelling with a <k> since the early Middle English era, which would lead one to think the pronunciation was indeed /k/. And there is the axian form, which would be pronounced /ks/. So the /k/ sound is the most likely in this case.