Yes, wearing leggings to work in the office is perfectly acceptable. The main thing is to combine them correctly with other clothes.