The empty set $\varnothing$ is not a neighborhood of any point $x\in X$, because as you correctly observed, there are no elements of $\varnothing$. However, the examples you are citing are not claiming that $\varnothing$ is a neighborhood, so there is no contradiction.
The examples are sets $X$ together with a topology $\tau$, so to say that a subset $U\subseteq X$ satisfies $U\in\tau$ means that $U$ is an open set, not (necessarily) a neighborhood of any particular point $x$.
From that Wikipedia page:
Given such a structure, we can define a subset $U$ of $X$ to be open if $U$ is a neighbourhood of all points in $U$.
The subset $U=\varnothing$ vacuously satisfies this property, because there are no points in $\varnothing$.
You’re right that $D[x]$ need not be an open neighbourhood of $x$. As a simple example of this, note that $D=\{(u,v) \in \mathbb{R}^2: |u-v| \le \varepsilon\}$ is an entourage for $\mathbb{R}$ in the standard uniformity induced by the metric $d(x,y)=|x-y|$. And $D[x]= \{y\in \mathbb{R}: |x-y| \le \varepsilon\} = [x-\varepsilon, x+\varepsilon]$ is not an open neighbourhood of $x$. This is basically due to the fact that entourages are closed upwards for inclusion, the basic entourages induced by a metric are usally set to be of the form $D=\{(x,y): d(x,y) < r\}$ and these induce just the usual (open) balls as neighbourhoods.
As to the product $X \times X$, where we see $X$ just as a topological space (as James also does). This has a base of open sets of the form $U \times V$ where $U,V$ are open subsets of $X$, as is well-known. This implies that a set of the form $N_x \times N_y$ is a neighbourhood of $(x,y)$ in $X \times X$ iff $N_x$ is a neighbourhood of $x$ and $N_y$ is a neighbourhood of $y$:
Proof If $N_x \times N_y$ is of that form, then there is an open set $O_x$ of $X$ such that $x \in O_x \subseteq N_x$ and an open set $O_y$ of $X$ such that $y \in O_y \subseteq N_y$. This is just the definition of $N_x$ resp. $N_y$ being a neighbourhood of $x$ resp. $y$ in a topological space. But then of course $O_x \times O_y$ is product open in $X \times X$ and $(x,y) \in O_x \times O_y \subseteq N_x \times N_y$, so again by the definition of neighbourhood we have that $N_x \times N_y$ is a neighbourhood of $(x,y)$ in $X \times X$. On the other hand, if we know $N_x \times N_y$ is a neighbourhood of $(X,y)$ in $X \times X$ there must be a product open set $O$ such that $(x,y) \in O \subseteq N_x \times N_y$. So by the definition of a base there exists a basic open set $U \times V$ in $X \times X$ (so $U$ and $V$ are open sets of $X$) such that $$(x,y) \in U \times V \subseteq O \subseteq N_x \times N_y$$ It follows easily that then $x \in U \subseteq N_x$ and $y \in V \subseteq N_y$, showing that indeed $N_x$ and $N_y$ are neighbourhoods of $x$ resp. $y$ and we are done.
Another easy observation which holds for all topological spaces: if $A \subseteq X$ and for each $x \in A$ we have a neighbourhood $N_x$ of $x$ in $X$, then $\bigcup_x N_x$ is a neighbourhood of $A$ in $X$. This is immediate from the definition of neighbourhoods and the fact that open sets are closed under all unions.
Now, what James has shown in the quoted computation is in fact that if $D$ is an entourage and $M \subseteq X \times X$:
$$D \circ M \circ D = \bigcup\{D[\xi] \times D[[\eta]: (\xi, \eta) \in M \}$$
which by all the previous remarks is just a union of product neighbourhoods of all points of $M$ and so a neighbourhood of $M$ in the product.
Hope this clarifies the matter somewhat. It’s mostly observations on neighbourhoods in general that are needed here, plus knowing what basic open sets in the product are.
Best Answer
I talk about neighbourhood spaces and topologies in this post. There we assign to each point $x$ of $X$ a neighbourhood system $\mathcal{N}(x) \subseteq \mathscr{P}(X)$ satisfying certain axioms. So it consists of a function $\mathcal{N}: X \to \mathscr{P}(\mathscr{P}(X))$ (each point gets a separately assigned $\mathcal{N}(x)$ which is a (non-empty) filter of subsets of $X$, all of whose members contain $x$ etc.)
In said post I show how to define a topology on $X$ from this and how to go back from topologies to neighbourhood spaces in a bijective way.