Can drupal be installed on a subdomain and used on the main domain?
Yes, you can have Drupal run in subdomain and have a completely different web site coded on the domain root.

Just make sure that the subdomain is directed at the Drupal root. To be clear, the Drupal root directory is the one that contains the following files:

authorize.php
CHANGELOG.txt
COPYRIGHT.txt
cron.php
.gitignore
.htaccess
includes
index.php
INSTALL.mysql.txt
INSTALL.pgsql.txt
install.php
INSTALL.sqlite.txt
INSTALL.txt
LICENSE.txt
MAINTAINERS.txt
misc
modules
profiles
README.txt
robots.txt
scripts
sites
themes
update.php
UPGRADE.txt
web.config
xmlrpc.php