Upvote:4
Yes. The D visa allows you travel through any Schengen state on the way to your destination, and also to visit them as if you had a multiple-entry C visa with the same validity period.
That means you can spend up to 90 out of every 180 days in Schengen states other than the one which gave you a D visa, with the usual restrictions for a short-stay visa (no right to work, even if your D visa includes a work permit).