If $p > n/2$ and if $f \in C^2_c (\mathbb{R}^n \setminus \{0\})$ (twice continuously differentiable functions whose support is compact in $\mathbb{R}^n \setminus \{0\}$), then the weighted Hardy inequality to $f$ says that $$ \int_{\mathbb{R}^n} \frac{| f (x) |^p}{| x |^{2 p}} \,dx \le \Bigl(\frac{p}{2 p - n}\Bigr)^p \int_{\mathbb{R}^n} \frac{| \nabla f (x) |^p}{| x |^{p}} \,dx $$ Next an application of the classical Hardy inequality gives you, if $p \ne n$, $$ \int_{\mathbb{R}^n} \frac{| \nabla f (x) |^p}{| x |^{p}} \,dx \le \Bigl(\frac{p}{p - n}\Bigr)^p \int_{\mathbb{R}^n} |D^2 f (x) |^p \,dx. $$
If $p \in (n/2, n)$, then such functions are dense in the subspace of $W^{2, p} (\mathbb{R}^n)$ of functions that vanish at $0$, and this proves the desired inequality.
If $p > n$, then the inequality $W^{2, p} (\mathbb{R}^n)$ of functions that vanish at $0$ together with their derivative. It is important that the derivative vanishes as it can be checked that if $f \in C^2 (\mathbb{R}^n)$ and $f (0) = 0$, then $$ \frac{| f (x) |^p}{| x |^{2 p}} \simeq \frac{\rvert \nabla f (0)\lvert}{|x|^p}, $$ which is not integrable near the origin $0$ when $p > n$.