The SSL certificate has to match whatever host is typed in the browser's URL bar. If you type in a domain name, then the SSL cert has to match the domain name. If people use two different domain names, then you need two different SSL certificates (or one certificate that's valid for multiple domains). If you expect users to type in an IP address in the browser, then the cert would have to match the IP address.
However, in order to buy a certificate for an IP address from a reputable vendor (if the vendor will sign it at all), you need to be the owner of the netblock according publicly held records (e.g. ARIN, RIPE, etc.). See for example the GobalSign FAQ.