They're both correct, but they mean different things.
1. She works the hardest in the office.
This means that she works harder than anyone else in the office: she works harder than all her colleagues.
2. She works hardest in the office.
This means that she works harder in the office than anywhere else: she works harder when she is in the office than in any other place where she works.