In the vast majority of the books and examples you are referring to, the XBee is nothing more than a wireless cable between two or more devices. So as long as your ESP8266 has a COM port, and you are able to make the proper connections at the proper voltages, I don't see why it would not work.