Yes, the language $\mathcal{L}_M$ is used in writing down $\phi(m_1,\dots,m_n)$.
That is, if $\phi(x_1,\dots,x_n)$ is an $\mathcal{L}$-formula, it can't refer to elements of $M$ (except those named by constants). To express the fact that $\varphi$ is true of the tuple $(m_1,\dots,m_n)$ from $M$, let's add a constant symbol called $m_i$ for all $1\leq i \leq n$ and interpret $m_i$ in $M$ in the obvious way, namely as the element $m_i$. Now $\phi(m_1,\dots,m_n)$ is a sentence in the new, larger language. Formally, it's the sentence you get by substituting the constant symbol $m_i$ for the variable $x_i$ in $\phi(x_1,\dots,x_n)$.
If you add constant symbols in this way for every element of $M$, you can now write down all the first-order truths about tuples from $M$. This set of $L_M$-sentences is the elementary diagram of $M$. If you restrict your attention to atomic and negated atomic formulas, you get the atomic diagram of $M$.
For example, in the ring $\mathbb{R}$, $\pi^2 \neq e$ is a negated atomic $\mathcal{L}_{\mathbb{R}}$-sentence. There is no sentence in the language of rings which asserts that $\pi$ is not the square root of $e$. There's just no way to talk about these real numbers in the language of rings.
As for the motivation, the definition is preceded (this is from Marker's Model Theory: An Introduction, p. 44) by the sentence "Next we give a way to construct embeddings and elementary embeddings."
Ok, so the definition is supposed to be motivated by a desire to construct embeddings. After reading the definition, you might naturally wonder what it has to do with constructing embeddings.
Fortunately, this is answered by the very next lemma, which says that if $N\models \text{Diag}(M)$, then there is an $\mathcal{L}$-embedding $M\to N$, and if $N\models \text{Diag}_{\text{el}}(M)$, then there is an elementary embedding $M\to N$.
Re: $(1)$, yes, that's exactly what the result is saying.
And this holds uniformly since we can always look at expansions of our starting structures:
Suppose $d_1=(a_1,b_1),..., d_k=(a_k,b_k)\in A\times B$ and $X\subseteq (A\times B)^n$ is definable over $d_1,..., d_k$ in the structure $A\times B$. Let $u_1,...,u_k$ be new constant symbols and let $A'$ and $B'$ be the expansions of $A$ and $B$ gotten by interpreting $u_i$ as $a_i$ and $b_i$, respectively. Then $X$ is parameter-freely definable in the structure $A'\times B'$.
Re: $(2)$, perhaps surprisingly, the answer is no - in general, products of definable sets are not definable. This is because we "lose the coordinatization." For example, suppose both $A$ and $B$ are the group $(\mathbb{Z};+)$, and consider the set $$X=\{(a,b)\in\mathbb{Z}^2: a=0\}.$$ Since both $\mathbb{Z}$ and $\{0\}$ are definable in $(\mathbb{Z};+)$, the set $X$ is a product of definable sets, but it is clearly not definable since it is not fixed by all automorphisms (consider the map $(u,v)\mapsto (v,u)$, for example).
Best Answer
When Marker says “let $\mathcal M$ be a ring” he is saying that it is an $\mathcal L_r$-structure that satisfies the ring axioms, not just that it is an $\mathcal L_r$-structure. The definition of satisfaction applied to the ring axioms is the exact same thing as the definition of a ring from abstract algebra, so this is the same thing as saying it is a ring.
The $a_i$ are the coefficients of the polynomial $p.$ As Marker shows, the only parameters you need to write down the formula that defines the set of zeros of the polynomial are the coefficients of the polynomial. $A$ is some subset of the ring that contains all of the coefficients. So it has all the parameters we need: the set of zeros is definable from it.
Yes the $\bar b$ in the formula corresponds to the parameters, in this case the coefficients. As for $\bar a,$ in this case $n=1$ so $\bar a$ has just one component, in other words we are defining as set, as opposed to a higher-arity relation. The $a$ that satisfy this formula are exactly the zeros of the polynomial.