OP just provided an explanation for Robin Hood's business model, it was never stated that Robin Hood operates in accordance with the law.
In fact it is well known, that Robin Hood operated illegally for a long time and got fined by the SEC for its violations: https://www.sec.gov/newsroom/press-releases/2025-5
None of those violations are related to trade order flow.
The majority are related to customer protections, lack of data retention etc. With perhaps the violations related to the blue sheet data (transaction data), which is used by various financial regulators to sniff out illicit transactions.
Robinhood's been accused of selling out their retail customer by allowing HFT firms to frontrun retail trade. And yet, no evidence of such actions have been found so far.
The fact that violations happened is clear proof that violations can happen. You asked how RH could do front running when it's illegal - the same way they could and did violate customer protections when it is illegal.
Whether or not Robinhood could do it isn't the right question. The better question is whether or not it would make sense for Robinhood or any other actor to front run microscopic retail trades.
Do you understand how front running helps the front runner and hurts the large volume trader? I think if you did, you would realize that Robinhood has no reason to do it.