Layers ... ogres have layers <- Quote from a movie.
Dialog is a command-line or shell tool. It uses a terminal, which these days in practice means a terminal emulator. Communication with terminals is text-based, not graphics: programs display characters, you type characters. Today, the set of characters one can display is pretty rich, for example "8.9°C χ²ₙ=0.35" (with special symbols for degree, chi, square, and subscript n). You can also display line drawing characters to make boxes.
Traditionally, command-line IO was a single color; typically white on a black background, or the other way around. Then in the 1980s came the first color terminals, and in particular Digital's trend-setting VT100 and VT200 terminals. They allowed changing the graphical rendering of characters to be bold, underlined, blinking, and particularly for this discussion, also color. That is done by sending a few extra control characters along, which say "print the next few characters in red" or "move the cursor to this place on the screen". Those control sequences are called the ANSI sequences, or escape sequences, or the VTxxx sequences. On a Linux machine, you can get a pretty complete list (with historic discussion) of them by doing "man console_codes"; I don't know any place in FreeBSD that documents them, but they're easy to find on the web.
The traditional set of ANSI sequences either is black and white, or uses 8 colors. And it allows displaying characters in reverse (on a bright or colored background) for highlighting. That's really easy to do, just to "echo esc [ 31 ; 42 m hallo esc [ 0 m" (with no spaces and an actual escape character), and you'll get red text on a green background. The 8 colors are pretty standardized, with 0 being the normal foreground color, 1 red, 2 green, 3 yellow, 4 blue, and then my memory gets foggy about magenta and cyan. Color 7 is the background color, and colors 0 and 7 are a bit problematic to use (because the definition of black/white gets often confused with the definition of foreground/background).
So far for traditional, 40-year old ANSI codes. This is what dialog, ncurses, emacs and vi and such programs use. Some of these programs can be configured as to what colors they use for what (for example, you found .dialogrc, which I've never heard of), some can not.
The next layer is the following: How are these 8 colors mapped to real RGB values? And this is where it gets complicated. That depends on how you are accessing the virtual terminal. On a non-virtual terminal, that mapping is done by the terminal hardware. I don't have any color terminal at home, but I still have two VT200 (clones), and 40 years ago, we were happy to get 8 colors, and didn't worry about exact color mapping. Different terminal emulators have different way of adjusting the 8 colors. You already found the sysctl settings for the FreeBSD vt console; I don't know how that's done in the sc console (both console terminal emulators exist, and you can switch between them). For the Linux console, that adjustment is done by ANSI sequences, and I think on modern VGA hardware, that will always work. If you are using a desktop with Xwindows, the adjustment depends on your exact emulator; I remember adjusting the colors for xterm in .Xresources, but these days there are way more terminal emulators. If you are accessing your FreeBSD machine remotely (like I do, from a Mac using iTerm), you need to look at the terminal emulator for color adjustment.
So the answer to your question is: it depends.