Red and green are complementary colors on that old color wheel, an RYB model targeted for painters, where Red, Yellow and "Blue" are the primary colors. Also, they are complementary colors in a Lab* model.
A modern color wheel uses RGB as primary colors and CMY as secondary or vice-versa, CMY as primary and RGB as secondary.
In that model, Red is complementary of Cyan.
So, if they are opposite, yes, they have maximum contrast but only in hue. There are several types of contrast. We also have brightness contrast.
Although we have some color models like HSB or HSL where one component is brightness, in this case all the hues have the same brightness because it only interprets it as a series of numbers.
So we have to interpret the brightness component as a perceptual brightness.
In this case, I am converting the image to Grayscale using a typical conversion.
You now can see that the maximum brightness difference is between yellow and blue.
So in the case of an RGB-CMY color wheel, the maximum contrast is Blue-Yellow.
But we can also consider that black and white are the most contrasting colors taking only in account brightness.
But we also have saturation contrast.
If we have then one color saturated and one not, one bright and the other not, the most contrasting colors are considered yellow and black. That is why it is used on (non-warning or informative) road signs and school buses.