There's no painting rule that says you have to mix your colors on a palette before you apply them to a canvas. You can mix your colors on the canvas as you're painting, if you wish. To do it successfully the colors you're wanting to mix must not have dried yet (obviously) and if you won't want what's already on your canvas to be included in the mix, this must be thoroughly dry.
These photos show how a green was mixed on a canvas, using phthalocyanine blue and cadmium yellow acrylic paint. The brand of acrylic paint I used was M. Graham & Co., which has a long working time compared with most other acrylics. But you can mix colors on a canvas using any brand of acrylics, you just need to be familiar with how fast the paint will dry in the conditions you're working in. You need to work fast enough to get the colors mixed before the paint has dried. If you're painting with oil paints, you've of course got a considerably longer drying time for mixing colors.
I was mixing the green to create a background for a painting that would feature a fruit tree in blossom. My intention was not to create a flat, unified green background, but to mix a green that would that would be lighter and darker in places, as a green foliage background.