Whilst the order of mixing does not matter in theory (see e.g. Todd's answer) it can play a role in praxis: Consider an imperfectly isolated system (e.g. a coffe cup) in air. The loss of heat is among other things proportional to the temperature gradient (basically local difference in temperature). An intuitive example would be that it matters whether you let your tea cool for a while and then add milk, or add milk and then let it cool. The former will be colder after the same time.
Another thing to consider is that it gets more complicated once you have changes in phase. E.g. a molten salt will likely have much more energy than a solution at the same temperature. If you heat the components separately and later mix you will have a higher temperature than when you first make the solution and then heat them. (The example with salt might be a bit contrived as they generally have high melting points.)