It depends on what kind of parasites. The product in Heartgard, pyrantel pamoate, does not kill all parasites but is okay for roundworms. If you want to use that, you can purchase it VERY cheaply from Amazon. I think the best thing to do, however, takes your dogs stool sample to his regular vet a few times a year and have him checked for worms. It is likely that he will not even need any kind of treatment.
Fleas are another matter. If you live in an area where fleas are a big problem, it might be cheaper to use a medication like Triflexis that gets the fleas and prevents heartworm. If fleas are not much of an issue, you can use an over the counter topical (like Frontline or other inexpensive topicals sold in pet shops) or use natural flea control methods like a flea comb, vacuuming, and diatomaceous earth.
It depends on how big a problem fleas are, and how much you or the dog are bothered by them. I know some clients get upset if they see one flea.