When using the default PDF reader the tab is a normal web page that contains <object> with the internal viewer extension inside. The content scripts can run in the web page and modify DOM/CSS there, which is what Dark Reader does: if you inspect the page in devtools you'll see it simply inverts the colors of the object:
embed[type="application/pdf"][src="about:blank"] {
filter: invert(100%) contrast(90%);
}
It doesn't run inside the viewer.