How to parameterise the xcode version inside executors in CircleCI Config file?

version: 2.1

executors:
  macos_default:
    macos:
      xcode: "12.3.0"
  macos_large:
    macos:
      xcode: "12.3.0"
    resource_class: "large"

I want to pass 12.3.0 as a variable in xcode: so that in future if I need to change the version it would change for both the executors with a single change

You can use a YAML alias. I’m not sure it’s worth though if if you just have two instances of the Xcode version.