Interesting. Since a general $D$ is no longer necessarily the integers, you have to say what you mean by prime, as well as the fact that $D$ might have its own different definition of multiplication.
Pretty clear that you're referring to the "fundamental theorem of arithmetic".
We do, I believe, have something pretty similar happening in the ring $D[x]$, of polynomials in the single variable $x$, which turns out to be an integral domain itself.
The analog of primes would be irreducible polynomials. Those are polynomials that can't be factored into products of lower degree polynomials.
But, in general, $D[x]$ need not be a UFD, or a unique factorization domain. Thus it won't always be possible to factor into irreducibles uniquely.
However, if we start with a field $\Bbb F$, we do indeed get a UFD for $\Bbb F[x]$.
Turning it back down a notch, I probably should have started with whether or not $D$ itself is a UFD. Then, there's prime ideals, which may be considered to sort of generalize the primes.
Suffice it to say that this story is only the beginning, and that, as you hinted, algebra can be a very elaborate subject. Enjoy your studies!