This question is about comparing Hecke algebras and endomorphism algebras.
Let $\mathbf{A}_f$ be the ring of finite adèles of $\mathbf{Q}$ and let $K$ be a compact open subgroup of $\mathrm{GL}_2(\mathbf{A}_f)$. Associated to this data is a modular curve $M_K$ defined over $\mathbf{Q}$. Assume that $M_K$ is geometrically connected, in other words that $\det(K)=\hat{\mathbf{Z}}^\times$. Let $\overline{M}_K$ be the compactification of $M_K$, and let $J_K$ be the Jacobian of $\overline{M}_K$.
For any double coset $KgK$ with $g \in \mathrm{GL}_2(\mathbf{A}_f)$, we can define a Hecke correspondence $T_g$ on $M_K$. It induces an endomorphism $T_g$ of $J_K$ defined over $\mathbf{Q}$. The modular Hecke algebra is the $\mathbf{Z}$-algebra $\mathbf{T}_K \subset \mathrm{End}(J_K)$ generated by the $T_g$ with $g \in \mathrm{GL}_2(\mathbf{A}_f)$.
Q1. Do we have $\mathbf{T}_K = \mathrm{End}(J_K)$? In other words, is every endomorphism of $J_K$ modular?
In his paper Modular curves and the Eisenstein ideal, Mazur has shown that for $K=K_0(N)$ with $N$ prime, every endomorphism of $J_0(N)$ is modular (Prop. 9.5). He actually proves the stronger statement that $\mathrm{End}(J_0(N))$ is generated by the Hecke operators $T_p$ with $p \neq N$ and the Atkin-Lehner involution $W_N$. This relies on work of Ribet proving that $\mathrm{End}(J_0(N)) \otimes \mathbf{Q}$ is generated as a $\mathbf{Q}$-algebra by the Hecke operators.
Kani has also shown that for any integer $N$ and any $K$ satisfying $K_1(N) \subset K \subset K_0(N)$, the $\mathbf{Q}$-algebra $\mathrm{End}(J_K) \otimes \mathbf{Q}$ is generated by the Hecke operators $T_p$ with $p \nmid N$ together with explicit degeneracy operators.
Now let $F$ be a finite abelian extension of $\mathbf{Q}$. The base change $M_{K,F} = M_K \otimes \mathrm{Spec} F$ is again a modular curve, corresponding to the subgroup $K_F = \{g \in K:\det(g) \in U_F\}$ where $U_F$ is the compact open subgroup of $\hat{\mathbf{Z}}^\times$ corresponding to $F$ via abelian class field theory (it is defined as the kernel of $\mathrm{Gal}(\mathbf{Q}^\mathrm{cyc}/\mathbf{Q}) \to \mathrm{Gal}(F/\mathbf{Q})$). We say that a correspondence $T$ on $M_{K,F}$ is defined over $F$ if it commutes with the structural morphism $M_{K,F} \to \mathrm{Spec} F$. Let $\mathbf{T}'_{K_F} \subset \mathrm{End}_F(J_K)$ be the $\mathbf{Z}$-algebra generated by those Hecke correspondences which are defined over $F$.
Q2. Do we have $\mathbf{T}'_{K_F} = \mathrm{End}_F(J_K)$? In other words, is every endomorphism of $J_{K,F} = J_K \otimes \mathrm{Spec} F$ modular?
Note that in this case I don't even know whether $\mathbf{T}'_{K_F} \otimes \mathbf{Q} = \mathrm{End}_F(J_K) \otimes \mathbf{Q}$.
EDIT (22/02/17). I looked at the example suggested by Kevin Buzzard, namely the elliptic curve $E = X_0(32)$ over the quadratic extension $F=\mathbf{Q}(i)$. This elliptic curve has CM by $\mathbf{Z}[i]$ defined over $F$. I can show that the local Hecke algebra at 2 generates the full endomorphism ring of $E$ over $F$. The idea is to find a matrix $\gamma \in \mathrm{GL}_2(\mathbf{Z}_2)$ normalizing
$$K_F = \{g \in K_0(32), \det(g) \equiv 1 \pmod{4}\}.$$
Since $K_F$ contains the principal congruence subgroup $K(32)$, everything happens inside the finite group $\mathrm{GL}_2(\mathbf{Z}/32\mathbf{Z})$ so we are reduced to a finite computation. Using Magma we find that the matrix $\gamma = \begin{pmatrix} 1 & 0 \\ 8 & 1 \end{pmatrix}$ works. Note that $\gamma$ has order 4 so we are in good shape. The matrix $\gamma^2$ normalizes $K=K_0(32)$, so it induces an automorphism of $E$ of order $2$, which has to be $-\mathrm{id}_E$. It follows that $\gamma$ is the multiplication by $\pm i$ on $E_F$.
EDIT (13/04/17). I worked out the second example suggested by Kevin Buzzard, namely the Jacobian $J_0(p^2)$. Let $\delta_1,\delta_2 : X_0(p^2) \to X_0(p)$ be the two degeneracy maps, defined respectively by $z \mapsto z$ and $z \mapsto pz$. Consider the endomorphisms of $J_0(p^2)$ of the form $\delta_i^* \circ T \circ (\delta_j)_*$ where $T$ is any endomorphism of $J_0(p)$. This gives a copy of $M_2(\operatorname{End} J_0(p))$ inside $\operatorname{End} J_0(p^2)$. Since we know that the endomorphisms of $J_0(p)$ arise from double cosets modulo $K_0(p)$, it suffices to show that $\delta_i^*$ (resp. $(\delta_i)_*$) arises from a double coset of the form $K_0(p) g K_0(p^2)$ (resp. $K_0(p^2) g K_0(p)$). This is easily shown to be the case, and thus all these endomorphisms of $J_0(p^2)$ arise from double cosets.
I suspect that, at least after tensoring with $\mathbf{Q}$, the answers to Q1 and Q2 are yes and that there should be some proof by "pure thought". Considering Mazur's proof, the question over $\mathbf{Z}$ seems to be much more difficult. Any idea on it would be very welcome.