Yes, you can inject the conditional compilation symbols to an Azure Pipeline. It is very much similar to what you would have done in your local environment. In Azure Pipelines, you can publish your symbols to Azure Artifacts symbol server using the Index sources and publish symbols task as mentioned in this Publish symbols for debugging document.
We generally use MSBuild task in an Azure DevOps pipeline using a remote agent to work with the conditional compilation symbols. You can also use the Visual Studio Build Task for the same. But remember that locally we usually build with Debug mode. In Azure it builds with release mode as configured. Check this answer by for more information about it.
Which ever task you use, it should pickup your conditional compilation symbols and to do so make sure that they are setup for the 'Release' configuration not only for debug.
