we want to add flexibility in a master pipeline where we could choose
sub pipelines to be triggered
For this issue, there is a custom task in the Azure DevOps marketplace: Trigger Azure DevOps pipeline. With this task you can trigger a build or release pipeline from another pipeline within the same project or organization but also in another project or organization.

You can also add a powershell task to call the rest api to queue another release pipeline.
$token = "{PAT}"
$url = "https://vsrm.dev.azure.com/{Org name}/{Project name}/_apis/Release/releases?api-version=5.0"
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))
$JSON = @"
{
"definitionId": {release-def-2 definition ID}
}
"@
$response = Invoke-RestMethod -Uri $url -Headers @{Authorization = "Basic $token"} -Method Post -ContentType application/json -body $JSON
}