The latter creates alternants of the same lexical item since adjacent sounds condition the realization of the first and final phoneme.
finding a minimal pair of words differing in the first or last segment (as in [kanaX] and [kanaK]) is good evidence that these two phones ([K], [X]) are allophones of one another.