Sure it can. Just like you need to step through your door when declaring "I am leaving this country" even when the door is inside the country.
When Kirk says what he says, he isn't
saying "We are sailing over the edge of the galaxy as I speak". He is saying "I have the intent of leaving the galaxy, and for that reason I command you to punch in Warp 1".