I am using a MOD-WIFI-ESP8266(REV.B) board with the button. Can I use that button when the program is running to perform some action after the button is pressed?
Yes.
The button is connected to GPIO0 which is also used for initial boot configuration. When GPIO0 is in low/GND position then the serial bootloader mode would trigger (for serial upload); when GPIO0 is high/VCC then normal execution mode would start. Once the board boots in the desired mode, the button can be used as general-purpose button.