It's only legal in California, and if you witness it first hand, you wouldn't do it.
Too many people open car doors to throw out trash, ciggie butts, vomit, etc. In CA, you are not supposed to go more than 10 mph over traffic, but they go far faster. ~200 people a year die in CA alone on bikes.