you want device A to be the sender and device B to be a receiver? in short, this is not possible with just the esp8266 unless you are able to subscribe to the publish topic manually.
a workaround is to use a raspberry and node-red Using Node-RED as a Local Fallback Server