To prove the result I will use two facts which can be easily find in internet (if not, just tell me):

- Let $R$ be a integral domain. Then, $R$ is a UFD iff every non zero prime ideal contains a prime element (Kaplansky criterion).
- In an integral domain every prime ideal is principal iff it is a PID.

Now we are going to prove:

If $R$ is a UFD of Krull dimension one, then it is a PID.

Let $ \mathfrak{p} $ be a non-trivial prime ideal of $ R $ (the ideal $ \langle 0\rangle $ is principal and prime since we are working over integral domains). Since $ R $ is a UFD, we know that there exists some prime element $ p\in\mathfrak{p} $ (Kaplansky). But then $ \langle p\rangle\subseteq\mathfrak{p} $ which implies that $ \mathfrak{p}=\langle p\rangle$, as we assumed every prime ideal to be maximal. Since every non trivial prime ideal is now principal, we conclude that $ R $ is a PID.

Actually you can prove that the converse is also true, using the fact that every PID is a UFD. Then take a prime ideal which we know to be principal and suppose that it is not maximal, which leads you directly to a contradiction