Can a Sonoff Basic Switch be connected between a wall switch and a light?
There's no reason that wouldn't work unless the manufacturer advises against it. It's a possibility that frequent on/off cycling isn't good for it, but that's unlikely. It's somewhat likely that there will be a wifi reconnect lag, however, so take that into consideration.

Really, this is no different than a typical motion detector on a switch loop.