Some of the user properties are not updated in my SPO like SPS-Location and was thinking if there is a way to access an on-premise user profile from SPO site collection.
Thanks in advance.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
The proper way to work this would be to use a CSOM application to push attributes from Active Directory to SPO. As you're probably aware, Azure AD Connect does not synchronize all attributes from Active Directory to Azure AD, and on top of that, not all attributes are synchronized from Azure AD to the SharePoint Online User Profile Service.
What I would recommend is leveraging one of the existing samples, User Profile Batch Update API is a good place to start, to build a CSOM application that will push those attributes into SPO directly.