Say there are two airports in a city, a large one with a control tower, and a small uncontrolled airport. Say they're only a couple miles apart, such that the small airport is well within the larger airport's controlled airspace. Is anything stopping a pilot from flying directly from one to the other?
There is no rule that says that a flight needs to be at least x miles long. Most training flights don't even leave the vicinity of the airport, and they still count.
The only thing stopping your hypothetical scenario would be that the pilot taking off from the uncontrolled airport needs to obtain an airspace clearance before taking off. If the bigger airport is busy this could be denied, in which case the pilot would be stuck!