You can learn and practice ethical hacking on your own by using the wide array of resources available online. Books and courses are also a rich source of information, as they are in most computer science fields. You'll need practice, too, which you can get through virtual machines.