The consent string can be used in rtc-config in amp-ad component using the CONSENT_STRING macro but is there a way to use the consent string in the src attribute of amp-iframe?
No, there is no logic in the AMP library to provide this. You would need to generate this server side, and update the rendered output of the iframe to include that value in the URL.
source: work at Google on AMP