Yes, because (quadratic) number rings are easily shown to have dimension at most one (i.e. every nonzero prime ideal is maximal). But $\rm PID$s are precisely the $\rm UFD$s which have dimension $\le 1.\, $ Below is a sketch of a proof of this and closely related results.
Theorem $\rm\ \ TFAE\ $ for a $\rm UFD\ D$
$(1)\ \ $ prime ideals are maximal if nonzero, $ $ i.e. $\rm\ dim\,\ D \le 1$
$(2)\ \ $ prime ideals are principal
$(3)\ \ $ maximal ideals are principal
$(4)\ \ \rm\ gcd(a,b) = 1\, \Rightarrow\, (a,b) = 1,\, $ i.e. $ $ coprime $\Rightarrow$ comaximal
$(5)\ \ $ $\rm D$ is Bezout, i.e. all ideals $\,\rm (a,b)\,$ are principal.
$(6)\ \ $ $\rm D$ is a $\rm PID$
Proof $\ $ (sketch of $\,1 \Rightarrow 2 \Rightarrow 3 \Rightarrow 4 \Rightarrow 5 \Rightarrow 6 \Rightarrow 1)\ $ where $\rm\,p_i,\,P\,$ denote primes $\neq 0$
$(1\Rightarrow 2)$ $\rm\ \ p_1^{e_1}\cdots p_n^{e_n}\in P\,\Rightarrow\,$ some $\rm\,p_j\in P\,$ so $\rm\,P\supseteq (p_j)\, \Rightarrow\, P = (p_j)\:$ by dim $\le1$
$(2\Rightarrow 3)$ $ \ $ max ideals are prime, so principal by $(2)$
$(3\Rightarrow 4)$ $\ \rm \gcd(a,b)=1\,\Rightarrow\,(a,b) \subsetneq (p) $ for all max $\rm\,(p),\,$ so $\rm\ (a,b) = 1$
$(4\Rightarrow 5)$ $\ \ \rm c = \gcd(a,b)\, \Rightarrow\, (a,b) = c\ (a/c,b/c) = (c)$
$(5\Rightarrow 6)$ $\ $ Ideals $\neq 0\,$ in Bezout UFDs are generated by an elt with least #prime factors
$(6\Rightarrow 1)$ $\ \ \rm (d) \supsetneq (p)$ properly $\rm\Rightarrow\,d\mid p\,$ properly $\rm\,\Rightarrow\,d\,$ unit $\,\rm\Rightarrow\,(d)=(1),\,$ so $\rm\,(p)\,$ is max
Remark $ $ Examples of non-PID UFDs are easy in polynomial rings: if $D$ is a non-field domain then it has a nonzero nonunit $d$ so by here the ideal $(d,x)$ is not principal.
There is a theorem which says that if $R$ is a UFD then $R[x]$ is a UFD. The question then is whether $R$ is a PID implies that $R[x]$ is a PID, and the answer is no. In fact, it's a common fact that $R[x]$ is a PID if and only if $R$ is a field, in which case $R[x]$ is actually a Euclidean domain. So, if $R$ is a UFD which is not a field (e.g. $\mathbb{Z}$) then $R[x]$ is a UFD which is not a PID.
If you are asking about what extra conditions need to be imposed on a UFD to make it a PID the answer is the notion of a Dedekind domain. In other words, a ring $R$ is a PID iff it's a UFD which is also a Dedekind domain.
Best Answer
Your hypothesis is true, actually, in a commutative ring with identity, $a, b\in R$ has the lcm-property if and only if $(a)\cap (b)$ is principal.
Proof: If $(a)\cap (b)$ is principal, take $c\in R$ s.t. $(a)\cap (b)=(c)$, hence $a\mid c$ and $b\mid c$, ($c$ is a common multiple). In order to be $c$ the least common multiple of $a$ and $b$, another multiple of $a$ and $b$ must be a multiple of $c$. If $r\in R$ is a multiple of $a$ and $b$ then $r\in (a)\cap (b)=(c)$ so $r$ is a multiple of $c$. That means that the lcm of $a$ and $b$ exists.
On the other hand if the lcm exists, name it $c$. Convince yourself that $(c)\subseteq (a)\cap (b)$ as a result of $c$ to be a multiple of $a$ and $b$. On the other direction, if $u\in (a)\cap (b)$ then $a\mid u$ and $b\mid u$, and $c\mid u$ because $c$ is the least common multiple. So $(a)\cap (b)\subseteq (c)$.
Thus you don't need that P is a UFD, if the lcm exists, your statement holds.