You cannot enter Dumbledore's office in LEGO Harry Potter: Years 1–4. The office is not an explorable area in this game, which covers Harry's first four years at Hogwarts. During this period, the story does not require access to the Headmaster's office.
However, Dumbledore's office is accessible in LEGO Harry Potter: Years 5–7, where it plays a role in the later storylines (e.g., the Pensieve memories, the search for Horcruxes).