Can a Navy Captain run a military base?

Base commanders are typically Navy Captains.