Technically that Mac will run After Effects, but the experience might be OK, probably not great.
I have the 2018 16GB RAM version of that Mac laptop, and it runs well enough for my relatively simple After Effects work.
I boosted it with a Thunderbolt 3 eGPU, but that only helps the parts of After Effects that support GPU acceleration. The rest of After Effects depends on the CPU, and the 13-inch MacBook Pro has never been a high performer in the CPU department, more like middle to low middle.
The cooling system of the two-port 2018 13-inch MacBook Pro holds it back somewhat. The four-port model (which mine is) has two cooling fans, but the two-port model has only one fan. In a program that drives the CPU as hard as After Effects does, the 13-inch MacBook Pro is likely to run its cooling fans fast and loud much of the time. The single fan in the two-port 13-inch will probably cause it to throttle down the CPU sooner and longer because it will not be able to cool as well as the two fans on the four-port model. (Cooling and throttling should be much less of a problem with Apple Silicon Macs than on these older Macs with Intel CPUs.)
The 8GB RAM will really limit After Effects, especially for previewing. The length of a real-time RAM preview depends on the amount of free RAM for caching previewed frames. Under 8GB RAM, it’s likely that you might only get a few seconds of real-time RAM high-resolution preview before it can’t find more RAM and has to drop to non-real-time rendering. You will probably have to tweak down your preview quality settings to get a longer real-time RAM preview.
DaVinci Resolve also has rather high system requirements, so if you’re more or less satisfied with how that runs on a two-port 13" MacBook Pro, you might be able to live with running After Effects on it.