There are no definite rules for which particles should come before others, it is always dependent on context for which order the particles should come, either to emphasize a point, express emotion, or to make the sentence unambiguous. This does not mean you can just move around parts of the sentence however you want, some sentence orders may sound more natural in different contexts.
More important than particles, IMO, is the order of the Subject, Object and verb. Template sentences in Japanese are most likely to be written in this order.
Another point to consider is the fact that for the most part, clauses that modify something else usually come before that something else. Let's try your example from the most basic sentence. Following the Subject Object Verb order, we begin with
(Watashi wa booru wo nageru)
I throw the ball.
Okay, now we want to add that we threw it to Sakura. Either of the following sound natural.
(Watashi wa Sakura ni booru wo nageru)
I throw Sakura the ball.
(Watashi wa booru wo Sakura ni nageru)
I throw the ball to Sakura.
Comparing English to Japanese is not always a good idea, but I think it illustrates a good point here. Changing up the order emphasizes different things. The first sentences emphasizes who you threw the ball to. The second emphasizes what you what you threw (the ball).
Finally, we want to tell the reader where we were performing the action.
(kouen de, watashi wa booru wo nageru)
In the park, I threw a ball to Sakura.
(Watashi wa kouen de booru wo nageru)
I threw a ball, in the park, to Sakura.
I think both of these are fine, but the first one sounds more natural to me. Maybe a native speaker can comment on this. However, if we go with your first sentence:
(Watashi wa sakura ni kouen de booru wo nageru)
I threw Sakura, in the park, the ball.
公園で comes really close to the verb 投【な】げる, which makes it easy to mistake 公園で for "throw the ball using the park". With a bit of common sense, we can figure out that this is not the case, but putting it further away makes it less ambiguous. What's more, it comes between 桜に and 投げる, interrupting the flow of the sentence.
Okay, so what does this all mean? Well for me it means that the only way to learn word order is to get used to it. Subject Object Verb is a good template for creating sentences, but it is not the only one. Word order is used to portray emotion, emphasis, and disambiguate sentence structure. To understand it, I really recommend that you just let it go for now and learn it slowly through both articles and reading books.
Sentence Structure/ Element Order
Does Word Order affect meaning