We have different docker repo for lower and higher environments with diff URLs. We want to use the same deployment file in all the environments but these URLs are not allowing us to do so do we have a way where we can pass the whole docker url from outside as a param and consume in deployment file
Usually you can modify that when you are about to deploy. There are tools like kustomize, or just a simple sed, or more complex deployment tools do that templating.
Not sure about helm (never used it), but you may want to check that too
Helm could work, just use the same chart and update the values file.
If you are looking to have something just automagically do something like that. You could write a rule into the OpenPolicyAgent or use a custom admissioncontroller to append the proper registry url based on the cluster it is being deployed into.