I am fairly new to electronics, and I got a
NodeMCU 0.9 ESP-12 for my IOT Projects. I want to power it through the wall, and I have an adapter which outputs
5 Volts and
2.5 Amps. Is it safe to connect this to USB to my ESP-8266?
The quick answer is: Yes, it is safe.
The longer answer is: It depends what you connect to the NodeMCU, but in general, yes, you should be okay, as if you were to put that much load on the GPIOs on the ESP8266 then you will have fried it a long time before reaching the 2.5A limit.
Now the clarifications: Your power adapter, outputs a voltage of 5V, which coincides with the input voltage required by the NodeMCU; this is good. As long as the voltage is somewhere in the range 3.5-6V your NodeMCU will be alright.
Your power adapter CAN output up to 2.5A before its 5V output starts to drop, or the thermal protection of it, cuts the power completely. Fortunately, the NodeMCU will not require more than 500mA (0.5A), unless you are also driving some other load besides the NodeMCU, but I can confidently say that your power adapter, will have enough grunt to power your application.
If you want to get into electronics it is important that you understand the basics, such as Ohms Law.
Ohms Law defines the relation between Voltage (V), Current(I) and Resistance(R), and it boils down to just one formula, that uses the letters above. V=I*R or Voltage = Current * Resistance.
To explain this, it is a classic to use a plumbing analogy, where the Voltage is the water pressure that your city can provide at your home, the Tap in your house is the resistance, and the flow of water coming out of it is the current.
In your case the water pressure is 5V, and your NodeMCU us the tap that will allow only a certain amount of flow/current through it. The local water board is capable of delivering to you 2.5A of water flow, but your NodeMCU is only a small tap, and it will through only 0.5A of what the system is capable.
The are a lot of similarities between the plumbing world and electricity, but remember that these are only analogies, so not all rules apply across the board.
There are plenty of sources online that can explain it much better than I do, but I hope this gives you a start in the right direction.