No, quarks cannot spontaneously "flip" their charge from up to down or vice versa. The concept of quarks flipping their charges is not supported by our current understanding of particle physics. The electric charge of a quark, whether it is +2/3e (up-type quark) or -1/3e (down-type quark), is an intrinsic property that remains constant.
The strong nuclear force, mediated by particles called gluons, is responsible for holding quarks together within hadrons. This force is described by Quantum Chromodynamics (QCD), which is a part of the Standard Model of particle physics. In the context of the strong force, quarks exchange gluons, which result in the attraction between them.
Quarks do undergo interactions and exchanges of gluons, but these interactions do not involve a change in their electric charge. Instead, they involve the exchange of color charge, which is associated with the strong force. The exchanges of gluons between quarks affect their color charges, allowing quarks to interact and bind together to form hadrons.
The phenomenon you described, with quarks constantly flipping charges and attracting or repelling each other, is not accurate within the framework of the known laws of physics. The interactions between quarks are more complex and involve the exchange of gauge bosons (gluons) according to the rules of Quantum Chromodynamics.