Is a closed embedding of CW-complexes a cofibration?

This is only a partial answer:

If $X$ is a locally finite CW-complex and $A \subset X$ is a closed subspace which is also a CW-complex (but not necessarily a subcomplex), then $i : A \hookrightarrow X$ is a cofibration.

This is based on three well-known facts.

(1) Locally finite CW-complexes are metrizable.

See e.g. Proposition 1.5.17 of [1].

(2) Metrizable CW-complexes are ANRs.

This is due to the fact that CW-complexes are absolute neighborhood extensors for metrizable spaces.

(3) If $X$ is an ANR and $A$ a closed subset of $X$, then the following are equivalent:

a) the inclusion $i : A \to X$ a cofibration.

b) $A$ is an ANR.

See for example Proposition A.6.7 of [1].

[1] Fritsch, Rudolf, and Renzo Piccinini. Cellular structures in topology. Vol. 19. Cambridge University press, 1990.

https://epub.ub.uni-muenchen.de/4493/1/4493.pdf

See also https://sites.google.com/site/ksakaiidtopology/home/homepage-of-katsuro-sakai/anr.