Is there a unique homomorphism from a ring to its field of fractions?
No, it need not be unique in general. To see why, consider the chain of maps
$$R\xrightarrow{g} R\xrightarrow{f} Q(R)\xrightarrow{h}Q(R).$$
We can “toggle” what $g$ and $h$ are to get different maps from $R$ to $Q(R)$. Since $R$ and $Q(R)$ might have nontrivial endomorphisms, your canonical morphism won’t always be unique.
I wonder when it is unique, though. Certainly $\mathbb{Z}\hookrightarrow\mathbb{Q}$ is unique, but I’m not sure about other rings...
There can be more than one ring homomorphism $R\to Q(R)$. Let's look at an example to see why:
Let $R$ be the polynomial ring $\Bbb{C}[t]$. So $Q(R)=\Bbb{C}(t)$. If we pick any element $r\in\Bbb{C}(t)$, there is a unique ring homomorphism $\phi_r:\Bbb{C}[t]\to\Bbb{C}(t)$ with $\phi_r(t)=r$ and $\phi_r(z)=z$ for all $z\in\Bbb{C}$. Note: $\phi_r$ is the map which sends $p(t)\mapsto p(r)$ for each polynomial $p(t)\in\Bbb{C}[t]$. So if $R=\Bbb{C}[t]$, then there are lots of ring homomorphisms $R\to Q(R)$.