It seems that you are asking whether $X^*$ and $Y^*$ can be isomorphic (there exists a (bi)continuous isomorphism between them) when $X$ is a proper closed subspace of a Banach space $Y$.
Yes, this can happen. Even with Hilbert spaces. I would say especially with Hilbert spaces. It suffices that $X$ and $Y$ be isomorphic. And that's necessary if they are reflexive, like in the Hilbert case.
E.g.
a) $X=\ell^2(\mathbb{N})\subsetneq \ell^2(\mathbb{Z})=Y$ has $X^*\simeq Y^*\simeq \ell^2(\mathbb{N})$ isometrically.
b) More generally, for an infinite dimensional separable Hilbert space $H$ and any proper closed infinite dimensional subspace $K\subsetneq H$, we have $K^*\simeq H^*\simeq \ell^2(\mathbb{N})$ isometrically.
c) In $\ell^\infty(\mathbb{N})$, we have $c_0\subsetneq c$ and $c_0^*\simeq c^*\simeq \ell^1$ isometrically where $c$ (resp. $c_0$) is the subspace of sequences that converge (resp. to $0$).
d) And here is a somehow silly example: take $X=C([0,1])\subsetneq C([0,2]=Y$ with the obvious embedding which extends a function continuously by a constant on $[1,2]$. Then $X^*\simeq Y^*$ isometrically as follows from Riesz representation theorem. Or much easier, from the fact $X$ and $Y$ are obviously isometric.