Generally, yes—an urban planter box on a fire escape can violate building codes, fire codes, or building rules, and in many jurisdictions it will be prohibited outright. The key issue is that a fire escape is not a normal balcony or decorative space. It is a regulated emergency egress route. Fire codes commonly require exit access, fire escapes, stairs, landings, and ladders to remain clear and unobstructed at all times. A planter box can be treated as an obstruction even if it seems small, especially if it narrows the walking path, blocks access to a window, interferes with the drop ladder, or makes the landing harder to use during an emergency.
Planter boxes can also raise other code concerns. They add dead load and concentrated weight to a structure that may be old or not designed for planters, soil, and water. They can be combustible, catch wind, fall, trip someone, or create a projectile hazard. Some codes and property rules prohibit storage or personal items on fire escapes; planters may fall under that prohibition. Even where a planter is not explicitly named, a fire marshal or building official can classify it as an obstruction or unsafe condition.
The answer depends on your location and the specific fire escape. A required fire escape serving sleeping rooms or egress windows is usually held to a strict clear-space standard. A fire escape that is not part of the required means of egress may still be subject to building maintenance, façade, safety, and landlord rules. Many buildings also have leases, co-op or condo rules, or HOA policies that prohibit planters on fire escapes even if the public code is ambiguous. Insurance companies may also object.
Before installing a planter box, ask your local fire department or fire marshal and building department. Confirm whether the fire escape is a required means of egress and whether any objects are allowed. Get written approval from your landlord, property manager, or building board. If you are in a city with aggressive fire escape enforcement, assume the safe answer is no until an official says otherwise.
If a planter is ever approved, it should not be treated like ordinary balcony décor. It would need to stay within any allowed clearances, be secured against wind and falling, avoid blocking ladders and windows, respect load limits, and use lightweight, noncombustible or fire-resistant materials where required. But in most cases, the simpler and safer choice is to keep fire escapes completely clear and put the planter somewhere else, such as an approved windowsill, balcony, roof, or courtyard.
This is general information, not legal advice. Because fire escape rules vary by city and building, verify the answer with your local code official and landlord before you install anything.