You do understand the concept of wireless networking (WiFi)?
An ESP8266 is not different then, for instance, a mobile phone or laptop using WiFi or an access point or router.
You can turn an ESP into a client (requesting data from a server, in STA-mode), a server (responding to requests from others, in AP-mode) or both at once (in STA/SoftAP-mode).
If you want your ESP to be something in a network, you just have to configure it like any other device and use the appropriate software (or "Firmware") to perform this task.
In your case (as you've described) you want the ESP to perform as a server (serving requests from other clients) inside your network, so you have to set things up like any other server (for instance a webserver or FTP-server on a normal PC).
When the correct software is installed (= firmware is flashed), you have to let your server connect to your network (so it will be in STA-mode) and give it an IP address (dynamically using DHCP or statically, doesn't matter, but static is easier to keep track of).
After that, any device within the network can communicate with your ESP-server.
If you want to be able to access your ESP-server from outside your network, you have to forward its port to the outside by adding a port-forward rule inside your modem/router.
As said: the ESP is exactly like any other network device, albeit a little smaller.
As long as you don't confuse being a client/server with STA/AP-mode (they're not the same):
- Client: asks data from a server
- Server: replies to data requests from a client
- Station: a network device wanting to connect to an access point
- Access Point: a central device connecting stations that request a connection