I vividly remember the first time I booted into Android, going into the settings and under the geo-location tab, you are expressly asked whether you’d like opt-in to anonymous location data collection and whether you’d also like to use your location for search results and other Google services.
So yes on Android your location can be tracked but you’ll first have to approve of it. Then even with that the collected data is anonymized in such a way that it cannot be traced back to you as per this Google statement
All location sharing on Android is opt-in by the user. We provide users with notice and control over the collection, sharing and use of location in order to provide a better mobile experience on Android devices. Any location data that is sent back to Google location servers is anonymized and is not tied or traceable to a specific user.