I have heard that in Star Wars the irl/out of universe reasoning for the Rebel Alliance lasers being red and the Empire's being green is that post WW2 US and NATO tracer rounds were red while USSR and China's tracer rounds were green. This would cause American veterans of Korea and Vietnam to associate red with allies and green with enemies due to Soviet/Chinese support of the opposing forces in those wars.
So that said I have 3 questions
1 Is the color distinction I described of red for ally green for enemy accurate for that post WW2 time period?
2 If 1 is accurate is it due to who was supplying the tracer rounds? US to American service men and USSR/China to Korea/Vietnam?
3 If 1 and 2 are accurate was this information consciously used by the people making Star Wars?
I can provide an answer for number 3, which is yes. George Lucas based a lot of Star Wars off of World War 2 and other wars/conflicts. It is highly probable that he considered this when creating Star Wars, since he took inspiration from the Vietnam War. This isn't the only evidence of George Lucas "borrowing" from history, either, some Imperial helmets are based on the German Stahlhelm, and guns/gun crews were similar to WW2 artillery and their crews.
Source: https://www.history.com/news/the-real-history-that-inspired-star-wars
And some of my past, personal research on Star Wars (huge nerd with Star Wars).