First, I hate iframe which is very old-school stuff and problematic for web analytics.
They are double server calls as both page A and page B have tracking codes implemented and triggered to capture their page views.
Per Vinoth's suggestion you can create a condition to check if the current page is embedded in an iframe and skip the tracking if it is true. However, one more consideration is that if there is navigation within page B going to page C which is still within the same iframe, you will not have tracking for page C and no idea about such navigation since you skipped the embedded page view tracking.
My past practice is letting both page views be triggered, yet it increases cost as more server calls and even has issues with bounce rate measurement if they are a landing page.
However, the actual approach depends on your website design and how substantial the hosting page and the embedded page are. If the hosting page contains only the header and footer, where major contents are on the embedded page, you may skip the hosting page view tracking. If the embedded page is only a small piece of dedicated content without in-frame navigation (think about the YouTube iframe player), you may skip the embedded page view tracking. However, if both the hosting page and the embedded page have a similar share of contents and navigation, you may consider having both tracked.