The two are entirely separate. A private server runs its own account database and its own client version, so nothing you do there touches a retail subscription — and a retail account certainly does not grant access to a private one.
Worth being clear about: private servers violate Blizzard's terms of service and carry real risks, from malware in the client to losing any time invested if the server disappears. Retail access is only ever what you pay for.