My proof
$I=<a_1,\dots,a_n>=Da_1+Da_2+\cdots +Da_n$
let $g=gcd(a_1,\dots,a_n)$
Then since Bezout's identity holds and the binary operator gcd is associative, $g\in I$.
Also any element of $I$ is divisible by $g$. Thus $I=<g>$ and hence $D$ is PID
I have two questions, is the proof correct? and Where did I use the fact that $D$ is UFD? I think $D$ being Integral Domain with identity is enough as well.