Typical situation: you fly into an enemy sector and pin some ships there with your ships. Now the enemy builds some starbases to pin your ship and let them be pinned so he can move his ships out of the sector (and into yours). Is this legal?
Starbases are classified as "Ships" (see page 6 of the manual), and despite their lack of a drive they work exactly like any other Ship as far as the game mechanics are concerned. This would include being able to pin, or be pinned by, opposing Ships. (see also this response by one of the game designers to a related question)
As per page 14, the relevant rules for pinning are,
As the rules clearly specify "Ship" without qualifying it further, they would apply to Starbases as they would any other Ship. So yes, the move was legal.