Yes, the Azure DevOps pipeline can build net5.0 apps. If you want to build with the ".Net Core" task add the "Use .NET Core" task before it, with the correct version:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '5.0.x'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
I hope this helps.