It is okay to mix semi-gloss and flat paint together, if both paints are latex in nature?
To answer shortly no absolutely not. If you do that and paint you will end up with different sheen's all over the surface you paint. it will look horrible. Flats only with flats and eggshell with eggshells, and so on.
Yes you can as long as both paints are water based, latex or acrylic. The biggest problem you could run into in the "non-standard" sheen you will get. This will wind up similar to a satin but not quite.
Every manufacture has a different definition of specific sheens. So if you wind up not having enough, for a second coat or touch-up, you will be somewhat screwed.
Also, as mentioned above, you will have to mix the 2 gallons very well or wind up with a funny looking mess. Make sure to use a 5 gallon bucket and a paint mixer mounted to a drill. Mix for several minutes before painting.
Keep an eye on the mix. Sometimes different paints from different manufactures won't play well together. You will know if this is the case.