How come esp8266 is able to generate 2.4 GHz wifi signals
The radio contains a voltage controlled oscillator that is locked to an external reference oscillator using a phase locked loop (PLL). This results in a very precise high frequency signal for the radio on the chip. The radio will use one or more oscillators to upconvert and downconvert the signal to the required RF channel. This will be entirely distinct from the actual CPU clock, though it is possible the CPU clock is derived from the same reference clock. It's the same story for any device with a radio; the digital logic that directly interfaces with the radio usually only runs at a few 100 MHz or less, even if the radio operates in the 2.4 or 5 GHz bands.

The most important thing to remember about radio communications is that even though the channel can be located at a high frequency, the channel is quite narrow.  In the case of Wi-Fi, the channel may be centered between 2.4 and 2.5 GHz, but it is only 20 MHz wide (or perhaps 40 or 80 if multiple channels are bonded in newer standards).  Since the band is only 20 MHz wide, most of the signal processing ony operates up to around 20 MHz.  If there are ADCs and DACs, they will probably only run at 100 Msps or so.  Any DSP circuitry will run at this rate as well.  Mixers will then be used to convert between this 'baseband' and the actual RF channel.