Do you have any idea as to why it would be illegal? In my country it's not at all unusual to see a product in a supermarket being sold at a discount price in a display at the front of the store, but at the usual price on the usual shelf.
I believe as long as it's a different physical store, it's probably possible to set a different price.
My impression (that would need more research) is that having two different prices for the same product at the same time inside the same physical store or on a website would be problematic; otherwise it's probably ok.
I think I really need to make more research - A/B pricing would definitely be interesting.