I would like to boot from usb but is my hard drive totally safe if I am booting from usb drive and can viruses get from usb drive to hard drive?
I'm assuming you're referring to running linux from a liveusb here.
Your hard drive will have to be mounted before the live boot would be able to even touch it.
If you burn any standard Linux live ISO to the usb drive or to a CD, such as Ubuntu, GNONE, Elementary OS (these are just some examples), they don't mount drives/partitions automatically unless you run their installers. You can also manually mount the drives/partitions by opening them in the distribution's file manager or by running some
mount terminal commands.
Can a virus infect your hard drive? It is possible, but you'd have to be pretty reckless about what you give root access to. If you're super paranoid you could just take the hard drive out whilst you're running a live boot, but that's just overkill.
In a nutshell, you are safe, and nothing will happen to your hard drive as long as you don't install the Linux distribution or run some file destroying commands on your hard drive partitions.