#Depends on the reach of the grappling creature
Depends on the reach of the grappling creature
Opportunity Attacks occur when
...a hostile creature that you can see moves out of your reach
Where the grappling occurs will entirely depend on the reach of the creature grappling. If they have a 5' reach, then the grappled creature remains 5' away. If they have a 10' reach, then the grappled creature remains 10' away. It's all about the distance they are at when the fleeing creature leaves the reach of the grappling creature.
The Vampire Spawn
##The Vampire Spawn InIn the case in question, a Vampire Spawn has a 5' reach on their Claws Attack.
+6 to hit, reach 5 ft., one creature. Hit: 8 (2d4 + 3) slashing damage. Instead of dealing damage, the vampire can grapple the target (escape DC 13).
If they choose to use this melee weapon attack for an Opportunity Attack, then the fleeing creature would be grappled at 5' (next to) the Spawn.
Some creatures can draw their grappled creature in
##Some creatures can draw their grappled creature in TheThe Roper has a 50' reach(!) on their Tendril Attack which grapples its target on a successful hit.
This then pairs with its Reel Action that
pulls each creature grappled by it up to 25 feet straight toward it.
This is the type of effect you were imagining, but it is only active on creatures who have that specific ability.
All other creatures simply grapple the creature via an Opportunity Attack at the point in which they would leave the reach/range of the grappler.