The answer to the question the way it is formulated is no, because if $\varepsilon<\delta$ and $f(x)=ax$ for some small $a$ we would have that $f$ equals identity on $B(\delta')\setminus B(\varepsilon)$ which is not the case. It is however, clear what OP had in mind and in fact the following general gluing result is true:
Theorem. Let $\Omega\subset\mathbb{R}^n$ be open and let $D_1$ and $D_2$ be $C^k$-closed balls, $k\in\mathbb{N}\cup\{\infty\}$, such that $D_2\subset\mathring{D}_1\subset D_1\subset\Omega$. If $F:\Omega\to\mathbb{R}^n$ and $G:D_2\to\mathbb{R}^n$ are orientation preserving diffeomorphisms (onto the images) satisfying $G(D_2)\subset F(\mathring{D}_1)$, then there is a $C^k$-diffeomorphsm $H:\Omega\to F(\Omega)$ that agrees with $F$ on $\Omega\setminus \mathring{D}_1$ and with $G$ on $D_2$.
By a $C^k$-closed ball we mean the image of $\overline{B}(0,1)$ under a diffeomorphism defined in a neighborhood of $\overline{B}(0,1)$, and by a diffeomorphism of a $C^k$-closed ball $D$ we mean a map that extends to a diffeomorphism in a neighborhood of $D$.
The above result is Corollary 1.4 in [GGH]. It follows from the Palais extension theorem [P], see also Extending diffeomorphisms.
[P] Palais, Richard S., Extending diffeomorphisms, Proc. Am. Math. Soc. 11, 274-277 (1960). ZBL0095.16502.
[GGH] P. Goldstein, Z. Grochulska, P. Hajłasz, Gluing diffeomorphisms, bi-Lipschitz mappings and homeomorphisms. arXiv:2404.13508 (2024).
[P] R. S. Palais, Extending diffeomorphisms, Proc. Amer. Math. Soc. 11 (1960), 274-277. ZBL0095.16502.