I ran gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark' and firefox isn't in dark mode, despite the fact that i have firefox configured to use the system theme and firefox is on GTK according to google.
Oh, Gnome 3.38. I'm not sure that version even supported dark mode, only dark themes. I won't comment on aging of Debian ;).
Btw, what version of Firefox are you using? Debian comes with ESR, so chances are, that firefox' "ui.systemUsesDarkTheme = 1" still works (it doesn't in newer releases).
This will get you 99%, but there are exceptions. I.e. Firefox is linked against GTK, but paints its own widgets with custom theming anyways. Telegram is linked against Qt, but has it's own theming/dark mode too.