You are in fact asking about an extension problem. If you only want to have differentiability on $X\setminus K$ this can be done as in Joseph van Name's answer or, as suggested by Pierre PC, with a partition of unity. However, you cannot have bounded derivatives of the extension on $X\setminus K$ (which youyour notation $C_b^k(X\setminus K,\mathbb R)$ suggests). Here is a rather classical example:
Set $\varphi:[0,1]\to \mathbb R$, $x\mapsto \exp(-1/x)$ and $\varphi(0)=0$ and let $K\subseteq \mathbb R^2$ be the cusp $K=\big([0,1]\times \{0\}\big) \cup \{(x,\varphi(x)):x\in [0,1]\}$. The function $f_0:K\to\mathbb R$ defined by $f_0(x,0)=0$ and $f(x,\varphi(x))=\sqrt{\varphi(x)}$ is continuous (because of the continuity of $\varphi$ and $\varphi(0)=0$) and has thus a continuous extension $f:\mathbb R^2\to \mathbb R$ by Tietze's extension theorem (if you consider instead $\varphi(x)=x^2$ you can write down an extension explicitely which, however, is neither necessary nor enlightening for the argument). On the other hand, there is no continuous extension $\tilde f$ with bounded partial derivatives because this would contradict the mean value theorem for $\tilde f$ on the vertical segments $\{(x,y): 0\le y\le \varphi(x)\}$.