I have a German D visa (long stay) for job purpose. I am planning to book a ticket to Frankfurt via Copenhagen. But not sure if I can take the domestic flight CPH->FRA by passing immigration in CPH with D visa (I know a Schengen visa would have no problem). Also, current pandemic may complicate the situation. Any advice?
The Schengen visa requirement and the exception for D-visa holders have the same legal basis (namely article 6 of the Schengen Borders code). To the extent that these rules would be suspended, legally or illegally, there is no reason to expect a distinction between Schengen short-stay visa and long-stay visas. So if you know someone who made this transit on a Schengen visa recently, this is great for you!
If anything, Denmark might impose restrictions on entering when coming from certain countries (as they did regarding Sweden and many other countries earlier this year) or for residents of certain countries. They could also conceivably forbid transit entirely (i.e. refuse entry unless you have a Danish residence permit or D-visa) but I don't see why they would welcome Schengen visa holders (i.e. short-term visits) over D-visa holders.
Consequently, I would recommend checking airlines, airport and governmental rules regarding lockdowns, restrictions on transit and travel, and Covid tests but not worry about the visa per se.
Finally, note that there is no separate ”transit” visa category anymore but only airport transit visas. As you would in any case have to enter the Schengen area in Copenhagen, that would not be sufficient and you would need a full Schengen visa (a “uniform short-stay visa”) for this transit.