Where can I change the color of the ruler (and/or) of the tab marks?

I am using the flatpak version of linux under KDE (just in case this is something inherited from the desktop environment theme).

Have you tried Tools>Options, LibreOffice>Application Colors? But I don’t think there is any setting for it because the ruler seems to be some UI widget. Perhaps through Qt customisation, but I don’t know where the configuration is in the OS.

You should search it in KDE settings. LO uses system colors in this case

OP states: “I am using the flatpak version…

From LibreOffice Flatpak site

The LibreOffice Flatpak is using LibreOffice’s GTK3 backend, which should offer the most complete set of features in LibreOffice, including support for Wayland. Older versions of the LibreOffice Flatpak were based on the GNOME runtime, but starting with LibreOffice 6.0.3 it is based on the smaller freedesktop.org runtime, which should not have any negative impact on functionality.

Hence it seems very unlikely to me, that KDE settings play a role, if flatpak is built on GTK3. Or do I miss something?

Indeed it is build on GTK3. However KDE settings allow changing GTK3 themes, so this is actually a correct, while not very specific answer. I played around with the GTK3 themes and indeed this changes the respective colors.