I want to build a device where a button is pressed on a small box and the press event is sent to a windows application on a nearby PC
An ESP8266 such as a NodeMCU board + button can send UDP or TCP to an application running on the PC. This assumes both the NodeMCU and PC are connected to the same network. There is no need for a serial port if your application can open TCP or UDP sockets.
can this board be used as a wireless serial port ?
Yes. If you have a legacy program running on the PC that only accepts input via serial port esp-link is a good solution. esp-link turns an NodeMCU (or any ESP8266) into a WiFi to serial bridge.