On Android, Location needs to be enabled for an app to access ambient wifi (scan of all nearby APs). On iOS, there is no API for ambient wifi, though their location API does use it behind the scenes.
On both iOS and Android, an app can access connected wifi even with location disabled.