Suppose you sample a point $x$ from a standard random variable and then you sample a point $y$ from a normal distribution of variance $1/x^2$. With probability $1$, $x\neq 0$, so it is possible to sample $y$. However if we try to write the distribution of the pair $x,y$, it turns out that it is not normalizable. Indeed we have
$$\pi(dx,dy) = \tfrac{1}{Z|x|}e^{-\frac{x^2}{2}-\frac{y^2}{2x^2}}dxdy$$
which gives infinity if integrated. However the sampling is possible. But how does it actually means to sample pairs $(x,y)$ if I'm sampling from something which is not actually a distribution?
The formula you give does integrate to 1, not $\infty$, which can be seen by first integrating in $y$ and then integrating in $x$. If you are worried about the slice where $x= 0$, the integral does not see single slices of functions and the value of the integral along a single slice (even if it is undefined or infinite) does not affect the value of the integral. Of course we must be using either an improper Riemann integral or a Lebesgue integral to make sense of this.