It's a tradition, but how that tradition began is something no one can explain.
Maybe the tradition of using red trucks as fire trucks came about as a way of distinguishing them and giving them a very eye-catching specification, which would help differentiate them from the everyday carriage trucks whose colors are mostly black as well as all other automobiles on the road. On the other hand, the reason for the choice of red as the official color for fire trucks could be traced to the belief in the early years that red from the iron oxide had a very high durability which was why it was often the choice color for outbuildings and barns. During that era, red was also the most easily produced color.
Whatever the reason could have been, the tradition began long ago, and stuck. In the middle of the 60s and in the early 70s, studies proved that the first colors to vanish in very low light conditions were red. Subsequently, several fire departments abroad and then the United States began to use colors like yellows and lime greens which all had very high visibility for all their fire trucks. Though this proved to be a very wise decision, but many diehard traditionalists hated and fought against the switch of fire truck colors from red to colors that had more visibility.
Today, red has managed to retain its place as the most popular and widely accepted color for fire trucks and most other types of emergency vehicles all over the world. But there are still other colors of fire trucks out there today. For instance, it is quite common to see fire trucks painted with colors like green, orange, blue, yellow, white and sometimes black.