Upvote:2
The fact that your spouse as a US visa has no impact on their eligibility for Dubai transit visa.
What will determine eligibility is the citizenship; assuming your spouse has Afghani citizenship - they will need to apply in advance for a visa (even for transit).
If you are flying Emirates, you can arrange a visa through them. For other airlines, marhaba
can arrange transit visas.