Why do aircraft have two brake pedals instead of one?
In an aircraft the brake pedals control the respective side brakes. This allows for the pilot to turn the aircraft not only with the pivoting nose wheel (if it has one) but also with the brakes. This allows for a very tight turning radius. 



(source)


  If each pedals controls different sets of wheels eg the left wheels
  and the right wheels of the main gear, is that not a safety flaw
  rather than measure given that at any point in time,


It is by design to allow for the tight turning. Some smaller aircraft also do not have a steerable nose wheel so differential braking is the only option.   


  it is impossible for the pilot to apply an equal amount of pressure to
  the brakes?


Pushing equally on each toe pedal will result in equal brake operation.


  Isn't ABS enough to the point that only one pedal is enough.


The pedals allow for brake steering which a single pedal would prevent. Airplanes also do have ABS but that simply prevents the tires from skidding. 


  Finally do both captain and pilot step on the brakes at landing. IF
  not then why have two pedals?


Im not sure, when I fly with an instructor or co-pilot in smaller planes only one person operates the brakes.