when does the copula become "な"?
Simply, だ turns into な when it modifies the following noun, which is の/ん in this case. な is the attributive form of the copula だ. So-called na-adjectives and ordinary nouns are technically both nouns, so they share the similar grammar pattern.
This の/ん is a tiny special noun commonly referred to as explanatory-no. This の/ん is a big topic in Japanese, so please read these first:
So, 夢なのだ/夢なんだ has an added nuance as compared to simple 夢だ. "スミスさんは将来日本の会社で働くのが夢なんだって" may be used in the following situations:
- When this sentence works as an explanation/clarification of the previous context.
スミスさんは毎日、日本語を一生懸命勉強してるよ。将来日本の会社で働くのが夢なんだって。
- When this sentence works as a preliminary remark (i.e., background information).
スミスさんは将来日本の会社で働くのが夢なんだって。お勧めの会社を知ってたら紹介してくれない?
- When you just realized this fact.
ねえ、今本人から聞いたんだけど、スミスさんは将来日本の会社で働くのが夢なんだって!