$\newcommand{\E}{\operatorname{E}}$The equality $\E(XY)=\E(X)\E(Y)$ holds if $X$ and $Y$ are independent and their expected values exist, but "only if" is wrong: generally this equality holds if $X$ and $Y$ are uncorrelated even if they are not independent. For example, let $X$ be $-1$, $0$, or $1$ each with equal probability and let $Y=X^2$; then that equality holds although $X$ and $Y$ are far from independent.
However, there is no need for that here. What is claimed is this
$$
\E\Big( (\hat\theta - \E\hat\theta)\underbrace{(\E(\hat\theta)-\theta)}_{\text{a constant}} \Big) = \Big(\underbrace{\E(\hat\theta) - \theta}_{\begin{smallmatrix} \text{the same} \\ \text{constant} \end{smallmatrix}} \Big)\E\Big(\hat\theta-\E(\hat\theta)\Big).
$$
Note well: the expression over the $\underbrace{\text{underbrace}}$ is a constant and may be pulled out of the expression $\E\Big(\cdots\cdots\Big)$. That was done.
I've edited the Wikipedia article somewhat to clarify this.
As for $\E(\hat{\theta} - \E(\hat{\theta})) = \E(\hat{\theta}) - \E(\hat{\theta})$, that is like $\E(\hat\theta-5) = \E(\hat\theta)-\E(5)=\E(\hat\theta)-5$. What is done with $5$ in this last sequence of equalities is done with another constant in the sequence of equalities that you ask about.
Finally, $\Big( \E(\hat\theta) -\theta \Big)^2$ is the square of the bias, and $\E\left( \Big( \E(\hat\theta) -\theta \Big)^2 \right)$, being the expected value of a constant, is the same thing.