I've used a 2" standpipe over a 1.5" p-trap.
Not inspected, but if the 1.5" standpipe is overflowing, and you can increase the size, then adding a larger receptor over the p-trap works sometimes.
If the 1.5" drain is plugged, then nothing is going to work.
I grew up in a home that had a 1.5" washer drain with a 12" riser.
It flooded all the time.
I bought the house next door, it also had a 1.5" washer drain, but I plumbed it with more height and it worked fine.
In fact, most homes before 1960 had 1.5" washer drains.
We don't do that anymore, the cost difference between 1.5 and 2.0 is nothing in the big scheme of things.
Some like the IPC are now requiring 3" for suds control on the horizontal.
I've also had pipe as large as 3" over a 2" p-trap that enabled me to put more drains into it.
I've also installed floor sinks that I can put drains into.
I've also installed laundry tubs that I can drain a washer into. The laundry tub has a 1.5" p-trap, and does just fine.
It's all about adding more sizing for the initial push from the washer.
Or in some cases, just a larger space to add drains to, like for soda dispensers or condensate drains.