I found on the Web and, also on mathstack, several examples and I decided to write an answer.
Example of ring where the gcd of two elements doesn't exist:
Consider the ring $\Bbb Z[\sqrt{-d}]=\{a+bi\sqrt{-d} : a,b\in \Bbb Z\}$, $d\ge 3$ ($d$ free-square). Then in this paper D. Khurana has proved that:
Let $a$ be any rational integer such that $a\equiv d\quad (mod\quad 2)$ and let $a^2 + d = 2q$. Then the elements $2q$ and $(a+ i\sqrt{d})q$ do not have a $GCD$.
Two examples of ring where the lcm of two elements doesn’t exist:
I use the following theorem:
Let $D$ be a domain and $a,b\in D$.
Then, $\text{lcm}(a,b)$ exists if and only if for all $r\in D\setminus\{0\}$, $\gcd(ra,rb)$ exists.
$1)$Consider the ring $\Bbb Z[\sqrt{-d}]=\{a+bi\sqrt{-d} : a,b\in \Bbb Z\}$, $d\ge 3$ ($d$ free-square); and a rational integer $a$ such that $a\equiv d$ $(mod\quad 2)$, then $lcm(2,a+i\sqrt{d})$ doesn't exist. Indeed this follows from the previous theorem. Note that $GCD(2,a+i\sqrt{d})=1$.
$2)$ let $R$ be the subring of $\Bbb Z[x]$ consisting of the polynomials $\sum_i c_ix^i$ such that $c1$ is an even number. If we consider $p_1(x)=2$ and $p_2(x)=2x$, $lcm(p_1, p_2)$ doesn't exist.
$\Bbb Q$ is a field $\implies \Bbb Q[X]$ is a PID. Then as $R=S^{-1}(\Bbb Q[X])$ where $S=\Bbb Q[X] \setminus \{0\}$ and localization of a PID is a PID, hence, $R$ is also a PID.
Best Answer
Hint $\,\ c\mid\gcd(a,b)\!\iff\! c\mid a,b\!\iff\! (c)\supseteq (a),(b)\!\iff\! (c)\supseteq \overbrace{(a,b)=(d)}^{\Large as+bt\ =\ d\ }\!\iff\! c\mid d$