Can we use nodemcu in real-time projects
It really depends on what your requirements are (which you did not state).

The NodeMCU (ESP8266) is not an ideal platform for "hard" real-time use as it needs to divide its processing time between running your program and processing Wifi. As such, the NodeMCU is not able to provide guaranteed response times to external inputs at all times.

However, there are many types of "soft" real-time projects for which it is suitable. It's extensively used in IoT projects and it utilizes a reasonably fast processor and provides plenty of memory for larger projects.