That is a creative idea, and I can understand why you would want to make a picnic spot more convenient. The short answer is: probably not. Most city parks and public spaces have strict rules against permanently or semi-permanently attaching anything to their benches. They worry about damage to the furniture, safety hazards for other users, and maintenance issues. A table that is not properly secured could also become a tripping hazard or get knocked over.
Instead of attaching a table directly, I recommend a few practical alternatives. First, you can look for picnic tables already provided in the park. Many urban parks have dedicated picnic areas with fixed tables. Second, consider a lightweight, foldable lap tray or a small portable table that sits on the ground next to the bench. These are easy to carry and set up, and they won't violate park rules. Third, some benches are designed with built-in side surfaces or armrests that are wide enough to hold a small plate or cup. You might find that some benches already offer a suitable spot for your needs.
If you really want to use a specific bench, the best course of action is to contact your local parks and recreation department. They can tell you the exact rules for that location and might even suggest a bench model that could be better suited for a picnic setup. Many city departments are open to suggestions, especially if your idea could improve the visitor experience. Just remember to always leave the bench in the same condition you found it, and avoid any modifications that could harm the furniture or disrupt others.