Backup power supply using capacitors to help esp8266 run for 3-4 seconds after power failure
It is certainly possible.

The size of capacitor needed would likely be in the super-capacitor class, with a capacitance over 1 F. However, you would now need to adapt your power electronics to handle this new load. When the super-cap is discharged it almost looks like a short-circuit from the perspective of a low power linear regulator.

It would be much easier to diode-OR your input power source with a set of AA batteries for back-up power.