Why do similar Airbus and Boeing aircraft use different flap and slat mechanisms?
While the aircraft you mention would appear to be similar, this is not really entirely true. Specification wise yes, but the period it was designed in has a huge impact. For instance:


The first flight of the Boeing 737 was in 1967, with the Airbus A320 following considerably later in 1987. (20 years later)
Boeing 747 first flew in 1969, the Airbus A380 followed in 2005. (36 years later)


Each redesign is expensive and time-consuming so if there is no conceivable benefit it is not done. There is no clear cut equation on when a certain type of slat and flap mechanism is chosen: 


The operating environment changes over time. One important consideration is the landing speed (and corresponding runway length). This for instance limited the Boeing 707 greatly, and it was likely that Boeing might not wish to run into the same problem with the B747 to enable it to serve as many markets as possible at a time when airports were not so advanced. For this reason they put in the very complicated triple-slotted flaps. (For comparison, look at the A380 which has caused headaches as airport operators have to modify and/or rebuild facilities to accommodate it)
Aircraft have become lighter over the years with the introduction of new materials, production techniques and better optimized engineering.
Technology has become better at modelling, so we can be less conservative in design choices as there is a better idea of the end result. This applies not only to the structure but also aerodynamics.


The bottom line is that you take the values and look at a few different designs. You choose the one that best fulfills your criteria (not only in performance but also what you can build) and go with it, and this choice would change over time. If the Boeing 737 would be built today, the details most probably be fairly different.

What does this mean?


The A380 for instance only has single slotted slats. When the B747-8i recently received a new wing design, it shifted from triple to double and single slotted flaps.
Both the A350 and B787, designed roughly around the same period, both have the rear single slotted flaps and (to large extent) the same slat design.