If $R$ is a domain and $p$ is an irreducible that is not a prime, then any witness to the fact that $p$ is not a prime yields a witness to the fact that $R$ is not a PID: suppose that $p|ab$, but $p$ does not divide either $a$ or $b$. Then $(p,a)$ is not principal: if $(p,a)=(x)$, then $x|p$; since $p$ is irreducible, either $x$ is a unit, or $x$ is an associate of $p$.
If $x$ is an associate of $p$, then since $(p,a)=(x)$ we have that $x|a$, hence $p|a$, a contradiction.
If $x$ is a unit, then $(p,a)=(x)=(1)$. Therefore, there exist $\alpha,\beta\in R$ such that $1=\alpha p + \beta a$ (since every element of $(p,a)$ is of the form $rp+sa$ for some $r,s\in R$), hence multiplying through by $b$ gives $b=\alpha b p + \beta ab$, and since $p|ab$, it follows that $p|b$. This is another contradiction.
Thus, $(p,a)$ cannot be principal. Of course, neither can $(p,b)$.
Hence, if $n$ is even and $n\gt 2$, then $(2,\sqrt{-n})$ is not principal in $\mathbb{Z}[\sqrt{-n}]$. If $n$ is odd and $n\geq 3$, then $\text{}$$(2,1+\sqrt{-n})$ 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
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.