In which types of rings does the equality $(a)(b)=(a) \cap (b)$ hold for all $a,b$? What properties must a ring have so that this equality holds? What properties must a ring $R$ have so that for any $a, b \in R$, we have $$(a)(b)=(a) \cap (b)?$$


If $k$ is a field, then in $k[x_1, \dots, x_n]$ I believe we have $(g)(h)=(g) \cap (h)$:
We always have $(g)(h) \subset (g) \cap (h)$ and conversely, if $f \in (g) \cap (h)$, then we can write $f=ag \in (h)$, hence $f=abgh \in (gh)=(g)(h)$.
Is this correct?
 A: This is not true in any integral domain that is not a field. Consider some $a\in R$ that is not a unit. Then $(a)^2\neq (a)\cap (a)$ because $a\notin (a)^2$. It's probably not true in general rings either, but the easy proof in integral domains relies on the cancellation property which is not present in general rings.
The problem with your proof is that even though $f=ag$ for some $a$, this does not imply that $f=abgh$. We only know that it is also the case that $f=bh$ for some $b$. There's no way to promote this to a multiple of $gh$ in general.
You commented: "If $f$ is a multiple of $g$ and $h$, then isn't it a multiple of $g\cdot h$?" This isn't even true for the integers. Take $g = 3$ and $h=6$. Then $f=6$ is a multiple of both $g$ and $h$ but not of $gh$.
To compile some comments, it would be true in a division ring (including fields), a ring with no proper nontrivial two-sided ideals, or any direct product of such rings.
In the currently only other answer it is stated that this is true if and only if $R$ is von Neumann regular. In fact the result is that the ring is strongly von Neumann regular, which means for any $a$ we have an $x$ such that $a=aax$. Ordinary von Neumann regular rings satisfy $a=axa$ for some $x$. It is clear that if the ring satisfies $(a)(b)=(a)\cap (b)$ for all $a,b$ then $R$ is strongly von Neumann regular. The opposite direction works for commutative rings, but it is unclear if it is valid for noncommutative rings.
A: The statement holds if and only if $R$ is von Neumann regular.
Indeed, suppose that $\forall a,b \in R\, (a)(b)=(a) \cap (b)$. Then, for any $a \in R$, $(a^2)=(a)(a)=(a) \cap (a)=(a)$, so $a \in (a^2)$, i.e. $\exists b \in R\, a=a^2b$. This means that $R$ is von Neumann regular.
Conversely, suppose that $R$ is von Neumann regular and $ac=bd \in (a) \cap (b)$ in $R$. Then, letting $e$ be the von Neumann inverse of $a$, one has that $ac=a^2ec=a^2ce=abde \in (a)(b)$. This means that $(a) \cap (b) \subseteq (a)(b)$, but it is also clear that $(a)(b) \subseteq (a) \cap (b)$, so $(a)(b)=(a) \cap (b)$.
