Power Down Interrupt Arduino
Not directly, no.  When an Arduino or ESP8266 has lost power it's lost power. You need external circuitry to keep providing power after the power input has been removed, and alert your target chip that power has gone.







simulate this circuit &ndash; Schematic created using CircuitLab

C1 wants to be massive. The ESP8266, because of the WiFi interface in it, consumes a lot of power.  Also, writing to EEPROM or Flash (which the ESP8266 has instead of EEPROM) takes extra power.

Ideally, C1 wants to be a small Super-Cap to keep the physical size small.  For an ESP8266 you're probably talking thousands of uF.

An alternative is to use the 47L16 (or similar) EERAM chip which is designed to save its internal SRAM contents to internal EEPROM when power is lost using its own dedicated capacitor-based power reservoir.