If both market maker A and market maker B offer the same price but B is going to pay them slightly more than A for your order, then they can legally route your order to B.
Many brokers do this now.
Front running is different entirely. For example, if you were about to buy a load of stock, front running would be Robinhood buying in before you, waiting for your order to clear the price level, and then selling a few ticks higher.
I really have most serious doubts about the idea that you can simultaneously get paid for order flow and deliver on your best execution obligations - the payment for order flow literally comes out of missed price improvement opportunities for the customer. FINRA seems to feel the same way and fired a warning shot over the bows last year: https://www.finra.org/rules-guidance/notices/21-23
Oh ffs no they don’t.
See https://www.washingtonpost.com/business/2021/01/29/robinhood...