Technically speaking, yes, an ESP8266 could act as an MQTT broker. In fact, someone has already tried it! By the end of their project, they claimed to have a broker that can bridge to a cloud MQTT broker, with a web interface and a decent amount of uptime. In the comments, they say that their code is proprietary, so you won't be able to use their code exactly, but it does serve as a proof of concept if you really wanted to use an ESP8266.

However, using an ESP8266 as a broker is likely to be a lot of effort. Using a Pi, as suggested by MatsK, would be far easier, and although Raspberry Pi units are a little more expensive (between £5 and £25 + postage, depending on which model you choose), you'll save a lot of time. With a Pi, you can just use an established broker like Mosquitto. On an ESP8266, there's no chance that Mosquitto would run, and you'd probably have to write your own broker or use a far less reliable one.

Alternatively, you could just connect all your ESP8266s directly to a cloud service like AWS IoT. This simplifies your setup, but does mean that every request is routed through the Internet, and you cannot control devices locally. If your Internet connection breaks using this approach, you'll also have no control over the devices.