can a subdomain rank as good as normal domains?

Let's say I have one subdomain and it has good on-site SEO, good backlinks, good content . can it rank as good as a normal domain would? Or can a subdomain rank #1 for a specific keyword?