The UserProfile service in SharePoint Online has a property named Office Location. By default, individuals can update that property by navigating to https://[tenant]-my.sharepoint.com/_layouts/15/editprofile.aspx
You can also map this property from on-premises Active Directory in the ADConnect program.
If you need help gathering this information from a large number of users, you can consider http://hyperfish.com