Yes, so long as you keep your passengers informed about the reasons for the run....assuming company procedures allow it. Any engine runs done at the gate will of course be at low power only, a high power run would need to be completed away from the gate, and most likely without passengers.
Disembarking and re-boarding 400 passengers would not make you popular with the Ground Staff.....

.....perhaps your plane was slightly smaller?