Let $K \subset \mathbb R^n, n \in \mathbb N$, be compact and suppose the measurable $f_n: K \to \mathbb R$ converge almost everywhere to a function $f: K \to \mathbb R$.
By Egorov‘s theorem, for any $\varepsilon \gt 0$ we may find a measurable $A_\varepsilon$ with $|A_\varepsilon| \lt \varepsilon$ and $f_n \to f$ uniformly on $K \setminus A_\varepsilon$.
One can always find an $A_\varepsilon$ additionally being open.
Question: Can one also always find a compact set $A_\varepsilon$ (satisfying $|A_\varepsilon| \lt \varepsilon$ and $f_n \to f$ uniformly on $K \setminus A_\varepsilon$)?
Sadly, the measure of the closure of an open set may be much larger than the measure of the open set, so I am not really sure where to start here. However, I was also unable to come up with a counter example.
Disclaimer: The following does not answer the original question, it only shows that $K\setminus A_\epsilon$ can be chosen compact.
First, assume we already have the Theorem of Egorov:
Let $(\Omega,\Sigma,\mu)$ be a finite measure space, that is, $\Sigma$ is a $\sigma$-Algebra and $\mu:\Sigma\to[0,\infty)$ is countably additive, and let $f,f_n:\Omega\to\mathbb{R}$, $n\in\mathbb{N}$, be $\Sigma$-Borel-measurable, such that $f_n\to f$ pointwise $\mu$-almost everywhere on $\Omega$. Then for every $\epsilon>0$ there exists a (measurable) set $A_\epsilon\in\Sigma$, such that $\mu(A_\epsilon)<\epsilon$ and $f_n\to f$ uniformly on $\Omega\setminus A_\epsilon$. (See e.g. Donald L. Chon, Measure Theory, second edition, p. 81, Prop. 3.1.4)
Now, if we additionally assume, that - under the assumptions of Egorov - $\mu$ is inner regular, that is, there exists a topology $\tau$ over $\Omega$, such that $\tau\subseteq\Sigma$ and
$\mu(E)=\sup\{\mu(K)|K\subseteq E \text{ compact with respect to }\tau\}\ \ \ \forall E\in\Sigma$,
then in Egorov $A_\epsilon$ can be so chosen such that $\Omega\setminus A_\epsilon$ is compact with respect to $\tau$.
Indeed, for $\epsilon>0$, take the by Egorov granted $B_\epsilon\in\Sigma$, such that $\mu(B_\epsilon)<\frac{\epsilon}{2}$ and $f_n\to f$ uniformly on $\Omega\setminus B_\epsilon$ and use the inner regularity to find a compact $K_\epsilon\subseteq(\Omega\setminus B_\epsilon)$ with $\mu((\Omega\setminus B_\epsilon)\setminus K_\epsilon)<\frac{\epsilon}{2}$. Set $A_\epsilon:=\Omega\setminus K_\epsilon$, then of course still $f_n\to f$ uniformly on the compact set $\Omega\setminus A_\epsilon=K_\epsilon$ and
$\mu(A_\epsilon)=\mu(B_\epsilon)+\mu((\Omega\setminus B_\epsilon)\setminus K_\epsilon)<\frac{\epsilon}{2}+\frac{\epsilon}{2}=\epsilon$.
Both, the Lebesgue and the Borel measure on $\mathbb{R^n}$ ($n\in\mathbb{N}$) or on any measurable subset of $\mathbb{R^n}$ are (inner) regular (where the needed topology is the usual one on $\mathbb{R^n}$). (See e.g. W. Rudin, Real and complex analysis, third edition, p.47 and p.50, Thm. 2.20, (b); see also D. Chon for some useful Statements about regularity of measures.)