Sure. But employers can prevent you from working for someone else at the same time as you are working for them.
So if you wanted to do a 6 hour shift for Uber and then after that do another 4 hours for Lyft. That would almost certainly be legal.
But the common practice today is to run both apps at the same time and pick up clients on both networks as requests come in. This is what people are talking about, and will almost certainly be banned.