It's illegal in my state. That said, I'll get in the motorized traffic lane if the bike lane seems unsafe; e.g., drainage grate parallel to direction of travel, glass in the lane, etc.
That said, if I'm riding in an unfamiliar location, I generally prefer riding in the motorized lane, regardless of local quirks. I've seen too many bike lanes end unpredictably, in the worst of locations. Think a curve leading to an old, narrow bridge where the cyclist has to join the main lane to cross. Or a massive pothole, or even the shoulder/bike lane washed out. Inevitably there's a stream of high-speed traffic coming right as I get to one of those pinch points, regardless of what the traffic has been.