That's acceptable and valid. As each page is self-contained and therefore has its own individual namespace and DOM, there's no harm in using the same ID across iframes as long as it only occurs once within each iframe document.
How to add titles to frames and iframes?
Provide unique and descriptive
title attributes for all
Additionally, best practice is to give the enclosed document a title element with content identical to the title attribute. For example:
<iframe title="My Daily Marathon Tracker" src="https://www.mydailymarathontracker.com/"></iframe>
Tips for creating descriptive frame titles.
- As previously mentioned, give the enclosed document a title element with content identical to title attribute.
- Replace placeholder titles such as “untitled frame” with a more appropriate phrase.
- Make each title unique. Don't duplicate titles, even if they are similar.