Yes, the inside of the lighting fixture is a suitable place to add additional circuitry. You should bear in mind that the fluorescent tube load is more demanding on it's switching circuit than a simple resistive load, but with a typical domestic tube being rated at less than 80 watts, the risk of overloading the switch should be low.
Many of these fixtures are metal. This might be a problem because it will severely attenuate the WiFi signal, and there is no obvious simple workaround to this. You might find that the roof void makes a more practical installation location.
This is probably a good time to remind you that unless you have had a consumer unit upgrade very recently, your lighting circuit is probably not protected by an earth leakage trip, so your lighting circuit is one of the most dangerous in the house to work with - sockets will be protected in all but >15 year old installations.