Communication between ESP01 Arduino NANO and using External Interrupt in Arduino NANO for other than communication program same time
D2 and D3 Pins on Arduino nano support external Interrupt. Hence, you have to use one of those for the interrupt.
Since you are using softwareSerial() you can easily remap it to other digital pins of the Nano.
Pins from D4-D12can be used for communication.
You just have to change the parameters in the softwareserial() as below:
SoftwareSerial mySerial(4, 5); // RX, TX;;for example