I don't know what you mean by "the cycle $f^{-1}(D)\subset Y$" (and not just because $f^{-1}(D)\subset X$), but for your question you don't need it to be a "cycle", so let's just assume you want the set.
The answer depends on $f:X\to Y$. For instance, if $X=X_1\cup X_2$ where $X_i$ are irreducible and closed in $X$, $Y=Y_1\cup Y_2$ where $Y_i$ are irreducible and closed in $Y$, $Y_1\cap Y_2=\{P\}$ is a single point, $f_1=f|_{X_1}: X_1\to Y_1$ is the blowing-up of $Y_1$ at $P$,
$f_2=f|_{X_2}: X_2\to Y_2$ is the blowing-up of $Y_2$ at a subvariety of dimension $d$ contained in $Y_2$ and containing $P$, and
then if $D\subset Y_1$ is a divisor which contains $P$, then $f^{-1}(D)$ will be a divisor on $X_1$, but will have dimension $\dim Y_2-d$ on $X_2$. So, even assuming that $Y$ is equidimensional $f^{-1}(D)$ might have different dimensional irreducible components.
So perhaps you'd want to assume that $X$ and $Y$ are irreducible, but I think even then you can get funny behaviour. Let $f:X\to Y$ be a small morphism, for example contracting a single curve on a threefold. Since your $X$ and $Y$ are projective, so is $f$ and let $H$ be a relatively very ample divisor that does not contain the entire special fiber (for simplicity let's assume that $f$ has only one non-trivial fiber) and let $D=f(H)$. Then $f^{-1}(D)=H\cup \text{special fiber}$, so again you can have irreducible components of (almost) arbitrary dimension.
One case when $f^{-1}(D)$ has only codimension $1$ components is if $D$ is a $\mathbb Q$-Cartier divisor.