У меня боли в боку.

English Translation

I’ve got a pain in my side.

Shouldn’t this be боке?

That would be logical if бок were in the prepositional case here. But it’s one of a relatively small number of nouns (mostly masculine and single-syllable) that can be put into the locative case, which is a minor case, not one of the six major ones.

Description of the locative case in Russian, with a relatively short list (not including бок) of nouns that can take it:
http://russiangrammar.info/locative_case

More comprehensive list of nouns (including бок) that can take the locative:
https://en.wiktionary.org/wiki/Category:Russian_nouns_with_locative_singular