Bézout's identity does not necessarily hold in a unique factorization domain.
In a general domain, a greatest common divisor of $a$ and $b$ is defined to be any element $d$ such that
- $d\mid a$ and $d\mid c$
- for all $c$, if $c\mid a$ and $c\mid b$, then $c\mid d$
In a unique factorization domain a gcd of two elements is proved to exist (via the middle school rule), but in any domain we can prove that if a gcd of $a$ and $b$ exists, then it is determined up to invertible elements; more precisely
if $d$ and $e$ are greatest common divisors of $a$ and $b$, then there exists an invertible element $u$ such that $e=du$.
Proof. By property 1 (applied to $e$), $e\mid a$ and $e\mid b$; by property 2 (applied to $d$), $e\mid d$. Similarly, $d\mid e$.
Hence $d=eu$ and $e=dv$, so $e=euv$ and either $e=0$ or $uv=1$. If $uv=1$, then $u$ is invertible; if $e=0$, we can take $u=1$.$\quad\square$