Any cat or dog, regardless of whether it is indoor or outdoor, can get heartworms. That is why it is recommended to do heartworm prevention, as well as flea and tick prevention, on ALL animals. Sorry, its it vet tech side in me coming out.
Sylvias, I wish the best for your friend and her dog, hopefully he can fight the worms.