Assuming that $(D,\mathcal D,\mu)$ is a complete measure space, that each $f_n:D\to\Bbb R$ is $\mathcal D$-measurable, and that a.e. refers to $\mu$:
there exists $E\in\mathcal D$ such that $f(x):=\lim_nf_n(x)$ exists for each $x\in E$ and $\mu(D\setminus E)=0$.
We can now define $f$ arbitrarily on $D\setminus E$, and the resulting function will be $\mathcal D$-measurable, because of the assumed completeness.
To see this define the function $g$ by $g(x):=\liminf_n f_n(x)$; $g$ is $\mathcal D$-measurable. Given a Borel subset $B$ of $\Bbb R$, we have the disjoint union
$$
\{x\in D: f(x)\in B\}=\{x\in E: g(x)\in B\}\cup\{x\in D\setminus E: f(x)\in B\}.
$$
The first set on the right is an element of $\mathcal D$ because $g$ is $\mathcal D$-measurable. The second set on the right is a subset of $D\setminus E$, which is $\mu$-null. By completeness, any subset of $D\setminus E$ is $\mathcal D$-measurable. It follows that $\{x\in D: f(x)\in B\}\in\mathcal D$, so $f$ is $\mathcal D$-measurable.