This seems nominally Retrocomputing, because there were plenty of computers that only offered a 4-color palette - or even just 2-color - at times. However, without reference to an actual production system, I'm skeptical that there were many, if any, practical systems using arbitrary colors in a small palette. See below for an actual implementation - Apple IIGS.
Typically a 4-color palette used 4 system-defined colors, with no easy way to change them. For example, IBM CGA had a 4-color 320x200 display mode. In this mode, each palette/intensity selection, which applied to the entire screen, used 4 colors from the standard 16-color system palette. Each 4-color palette included 3 fixed selections (green/red/yellow, cyan/magenta/white or cyan/red/white) plus one more color from the 16, which defaulted to black. You picked a mode and palette for your software from what you had available, and that was that. No tweaking of the R vs. G vs. B.
Later cards such as EGA allowed for selection of each color in a palette. However, those same cards typically skipped over the 4-color modes. For example, EGA modes included 640x350x2 (monochrome has its advantages at times in terms of speed and memory usage) and then jumps to 16 colors at various resolutions.
In the hypothetical sense of "what would be best", logically a 4-color palette matching the native mode of the device would be best. Which for most consumer devices from the past 40 years means:
- Red, Green, Blue, Black for monitors
- Cyan, Magenta, Yellow, White for printers
In each case, all other colors are built up from the primary colors, including white on monitors or black (except really a muddy gray) for printers (which is why printers normally have 4 colors - CMY + black (K) - but that would be a minimum of 5 colors - Cyan, Magenta, Yellow, Black, White (no ink)). *Except as pointed out in a comment, if you fill in a monitor at native resolution with an even mix of red pixels,green pixels and blue pixels, you get an overall "white" effect (at high enough resolution, at least) but really a muddied (possibly colorful, depending on the monitor and resolution) gray because it will be at ~ 1/3 the native white brightness of the monitor.
In fact, with printers it generally is a binary mode for each color - you can increase resolution or change the printed dot size, but you really can't say "50% cyan, 25% magenta, 10% yellow". On monitors it is different as both CRT and LCD monitors can vary the intensity of each pixel.
A bit of poking around and I found that the Apple IIGS includes a 4-color user-defined palette. According to Wikipedia, it included:
640×200 (4 colors, selectable from 4,096 color palette)
Presumably (I haven't verified, but nothing else makes sense) the 4,096 color palette is 4-bits (16 levels) for each of Red, Green, Blue.
That being said, if I had absolutely no advance knowledge of the contents of an image, I'd still go for Red, Green, Blue, Black as the universal 4-color palette. There may be some advantage to a particular intensity of Red vs. Green vs. Blue based on human vision, type of monitor, etc. but full intensity Red, Green and Blue plus Black (i.e., #FF0000, #00FF00, #0000FF, #000000) is certainly the easiest way to go.