Lets assume that the factor ring $A:=\mathbb{K}[X,Y]/(X^2+Y^2-1)$ is a UFD. Since $A$ has dimension $1$ and is noetherian, it is then a principal ideal domain.
The ideals $(X-1,Y)$ and $(X+1,Y)$ are different maximal ideals of $\mathbb{K}[X,Y]$ containing $X^2+Y^2-1$. Hence the images $(\overline{X}-1,\overline{Y})$ and $(\overline{X}+1,\overline{Y})$ are different non-zero prime ideals of $A$. Let $p$ and $q$ be prime elements of $A$ generating these ideals. Then $p$ divides $\overline{X}-1$ and $\overline{Y}$ as well as $q$ divides $\overline{X}+1$ and $\overline{Y}$.
Now the equation $\overline{Y}^2=(\overline{X}-1)(\overline{X}+1)$ in combination with the assumption about $A$ shows that $p^2$ must divide $\overline{X}-1$, since otherwise $p$ must divide $\overline{X}+1$, which implies the contradiction $p=q$.
The ring extension $A|\mathbb{K}[\overline{X}]$ is free of rank $2$ with basis $1$, $\overline{Y}$, hence every prime element of $\mathbb{K}[\overline{X}]$ splits into at most two prime factors in $A$. Consequently $\overline{X}-1=p^2$. Lifting to the polynomial ring yields an equation of the form
$
X-1=(f(X)+g(X)Y)^2+h(X,Y)(X^2+Y^2-1).
$
Note that obviously $g(X)\neq 0$ and moreover $f(X)\neq 0$, since otherwise $\overline{X}-1$ were divisible by $\overline{Y}$.
The first summand of the right hand side has degree $2$ in $Y$. Due to the term $2f(X)g(X)Y$ appearing in this summand, the polynomial $h(X,Y)$ must contain at least one monomial of the form $X^kY$, hence the second summand on the right hand side has degree at least $3$ in $Y$, a contradiction.