Let $R$ denote a UFD, and let $X = \{x_0,\cdots,x_{n-1}\}$ denote a finite set of symbols. Then $R[X]$ is a UFD. This follows, since if $R$ is a UFD, then so too is $R[x],$ for any symbol $x \notin R$.
Q. If $R$ is a UFD, and $X$ is an arbitrary set, possibly infinite, is $R[X]$ necessarily a UFD?
Key Idea $ $ Each successive polynomial ring extension $\,D\subset D[x]\,$ is factorization inert, i.e. the ring extension introduces no new factorizations, i.e. if $\, 0\ne d\ \in D\,$ factors in $\,D[x]\,$ as $\,d = ab\,$ for $\, a,b\in D[x]\,$ then $\,a,b\in D.\,$ From this one easily deduces that the requisite factorization properties extend to the ascending union $\,R[x_1,x_2,\cdots\,].$ The same ideas works for arbitrary inert extensions.
Remark $\ $ Paul Cohn introduced the idea of inert extensions when studying Bezout rings. Cohn proved that every gcd domain can be inertly embedded in a Bezout domain, and every UFD can be inertly embedded in a PID. There are a few variations on the notion of inertness that prove useful when studying the relationship between factorizations in base and extension rings, e.g. a weaker form where $\, d = ab\,\Rightarrow\, au, b/u\in D,\,$ for some unit $\,u\,$ in the extension ring.