Throwing a little bit of trash out of your vehicle into a park dumpster is usually okay and legal.
When it becomes illegal and a problem is when you bring all your household trash to the park and dump it all in the park dumpster.
Parks have no problem usually when you get trash out of your vehicle and then throw it in there or if you had a picnic at the public park and then threw away the trash such as paper plates, cups etc.
But you should not bring your home household trash to the park dumpster to dump it.
If you do that then it can be seen as illegal dumping even though the public park is public and the dumpster is considered public you cannot just dump all your trash in the park dumpster.