No. Let $X = \mathrm{Spec} \ k[x,y]$ and $Y = \mathrm{Spec} k[u,v,w]/(uw-v^2)$. Let $f : X \to Y$ be $(x,y) \mapsto (x^2, xy, y^2)$. Let $D$ correspond to the ideal $\langle v,w \rangle$. Then it is standard that $D$ is not Cartier. However, $X$ is a PID, so every Weil divisor is Cartier on $X$.
Note that the pull pack of the ideal of $D$ is $\langle xy, y^2 \rangle$ on $X$, which has an associated point in codimension $2$. However, I assume that you are defining pull pack of Weil divisors to mean that we take the codimension $1$ components of the preimage.
UPDATE The OP clarifies that he or she intended to impose that $f^* \mathcal{O}(D)$ be locally principal. In this case, the answer is "yes".
Let's convert to algebra. $A$ and $B$ are normal local rings, with maximal ideals $\mathfrak{m}_A$ and $\mathfrak{m}_B$. We have an injection $A \hookrightarrow B$, with $B$ a finite $A$-algebra. $I$ is a nonzero ideal of $A$ such that $BI$ is principal. We want to show that $I$ is principal.
Let $I$ be generated by $\langle f_1, \ldots, f_r \rangle$, and let $BI$ be generated by $\langle g \rangle$, so $f_i = g u_i$ for some $u_i \in B$. Our first claim is that one of the $u_i$ is a unit. If not, then all the $f_i$ are in $\mathfrak{m}_B g$ so $BI \subseteq \mathfrak{m}_B \langle g \rangle = \mathfrak{m}_B I$. This contradicts Nakayama's lemma.
So, without loss of generality, let $u_1$ be a unit. Consider $v_j : =f_j f_1^{-1}$. Clearly, $v_j \in \mathrm{Frac} \ A$. But also $v_j = u_j u_1^{-1}$ is in $B$. As $A$ is normal and $A \hookrightarrow B$ is finite, this implies $v_j \in A$. So $f_1$ divides $f_j$ in $A$ and $I$ is generated by $f_1$ as desired.