Where I live it is legal, but not advised (state DOT website) in all areas except downtown Salt Lake and St. George.
Where I work, Kansas, I actually don't know. Because ride on the street, which is legal, I haven't bothered to research further.
In large part, because you haven't given a location, it is impossible for anyone here to provide you with an answers; because answers to that question are location specific.