will ssl certificate on main domain work on subdomain
There is nothing specific about civi on your question, it is possible to use a wildchar certificate (*.site.com) or one that works for several subdomains.

If you want a simple and free certificate and that isn't offered by your hosting company, I recommend you "let's encrypt".