Base ref will give you the information about the base of a pull request - yes. This information is provided to you in the github context. So you can use this either as a variable in your workflow, or an environment variable in workflow executions. For example:
echo "Base ref is $GITHUB_BASE_REF"
Or to use this as a test for a step:
run: echo "Hello, world"
if: github.base_ref == 'refs/heads/master'
But if your goal is to create a workflow that only runs for pushes on a PR with a specific target branch then you can codify that in the trigger for the entire workflow: