The brick behind the veneer is not in good shape. It flakes off when I scratch it. Should I treat or seal the brick before I try to reattach the veneer?
Don't seal the brick. It will only prevent adhesive from bonding correctly. If the brick is loose remove it, vacuum the dust and re-install the brick.
If the mortar is loose scrape it out and re-point the joint with mortar or concrete caulking. Allow the repair to cure.
Brush or vacuum the brick face aand joints to remove any dust and loose debris. Same for the veneer; clean the back surface.
Get a cartridge of construction adhesive and load it in a caulk gun. I've had good results with PL400, but any brand name will do. Apply gobs of adhesive about the size of a quarter to the bricks face.
Press the veneer back into place trying to make the broken seam as tight as possible. Hold the repair in place with strips of duct tape.
When adhesive has set any gaps along the repaired edge can be filled with concrete caulk to keep water out.