One can define $e^x$, $\sin x$ and $\cos x$ in any Banach algebra by means of power series, e.g. $e^x = \sum x^n/n!$. Then, for any square root of $-1$ in the algebra (which we will denote by $i$, although there could be many, as there are in the quaternions), it is a formal consequence of the power series that $e^{ix}=\cos x + i \sin x$. Because these functions are defined via power series, this is all tautological, and there isn't really any deep significance.

There are things two that make Euler's formula interesting over the reals. First, $e^x$, $\cos x$ and $\sin x$ are usually defined by non-power series methods, and so Euler's formula expresses some sort of non-obvious relation. Second, these functions satisfy all sorts of identities which can be better understood in terms of the identity. However, when we are working over a noncommutative Banach algebra (like the quaternions or $n \times n$ matrices), we generally have that $e^{a+b}=e^a e^b$ only when $ab=ba$, and so the most useful algebraic property of $e^x$ is gone, which means that so are the interesting relations you might want.

**Edit:** I would like to explain the calculation done in

Robert's answer in terms of what I have written above.

Let $q=a+bi+cj+dk=a+r\frac{bi+cj+dk}{r}$ where $r^2=b^2+c^2+d^2$, and we have assumed $r>0$. Note that $\frac{bi+cj+dk}{r}$ is a square root of $-1$, which we will temporarily write as $\sqrt{-1}$. Since $a$ commutes with everything, we have

$$e^q=e^{a+r\sqrt{-1}}=e^a e^{r\sqrt{-1}} = e^a( \cos(r) + \sqrt{-1} \sin(r))= e^a(\cos(r) + \frac{\sin(r)}{r}(bi+cj+dk)).$$

So we see that everything follows from the standard formula $e^{ix}=\cos x + i \sin x.$