Let $M$ be an $n$ dimensional orientable compact manifold. For every $z\in H_{n-1}(M,\partial M)$ we can find a map $f: M\to S^1$ such that $[f^{-1}(*)]=z$ for any point $*\in S^1$ since $S^1$ is a $K(\mathbb{Z},1)$ space. Furthermore, $f$ is homotopic to a smooth map and $*$ can be chosen to be a regular value so that $f^{-1}(*)$ is a properly embedded submanifold.
My question is, for every properly embedded submifold $N$ of codimension 1, does there exist a smooth map $f:M\to S^1$ such that $N=f^{-1}(*)$ for some regluar point $*$ on $S^1$?
If $N = f^{-1}(p)$ for some map $f\colon M\to S^n$ and a regular value $p$, then the normal bundle of $N$ is trivial, being the pullback of the normal bundle of $p$ in $S^1$. On the other hand, if $N\subset M$ is a submanifold of codimension $n$ with trivial normal bundle, then the Pontryagin-Thom construction defines a smooth map $f:M\to S^n$ such that $f^{-1}(p) = N$ for some regular value $p$ of $f$. This construction and its consequences are very well explained in the last chapter of Milnor's ``Topology from the differentiable viewpoint''.
As a consequence, the compact counterexamples to your question are precisely those submanifolds with a non-trivial normal bundle, for example, the middle circle $N$ of the Möbius band $M$.
On the other hand, if you assume that $M$ is connected compact and orientable, and $N$ is orientable, then every codimension $1$ submanifold $N$ is the preimage of a regular value of a map $M\to S^1$ because in that case, the normal bundle has to be orientable and therefore trivial.