Not always. Consider a graph with 9 vertices $1,2,\dotsc,9$, in which $1,2$ are not joined, but both $1,2$ are joined with $3,\dotsc,9$.

Assume that it is isomorphic to an induced subgraph of $H(n,2)$, with $x_i\in \{0,1\}^n$ corresponding to $i=1,2,\dotsc,9$. Then $x_1$ and $x_2$ differ in at least 3 positions. We may suppose that $x_1=(a_1,\dotsc,a_n)$, $x_2=(b_1,\dotsc,b_n)$ with $a_i\ne b_i$ for $i=1,2,3$. Let $i=3,4,\dotsc,9$. Then for $x_i=(c_1,c_2,\dotsc,c_{n})$ we get either $c_i\ne a_i$ for at least two indices $i\in \{1,2,3\}$, or $c_i\ne b_i$ for at least two indices $i\in \{1,2,3\}$. In the first case the inequality $d_H(x_i,x_1)\leqslant 2$ yields that $c_i\ne a_i$ for exactly two indices $i\in \{1,2,3\}$, and $c_i=a_i$ for $i>3$. There exist exactly 3 such sequences. And 3 more sequences in the second case. But we should have 7 distinct sequences $x_i$'s, $i=3,4,\dotsc,9$. A contradiction.