Your general approach is pretty much correct in your last example:
hosts: “{{ hosts | default(‘bid-’+ dc) }}”
Although jinja2 recommends using a ~ instead of + for string concatenation, although both will work.
However, the real problem is with your variable. You have created the dc variable in your inventory, which means that it is scoped to the hosts within that group. Because you are using the dc variable in your hosts declaration, no hosts have been targeted, and additionally, the dc variable is per host, not global.
As such, you cannot use the dc variable in a hosts declaration due to variable scoping, and the dc variable not being defined at that point.
The only real place to define a variable that can be used in the hosts declaration is via the command line via -e/–extra-vars