There's a difference between civil legal aid and criminal legal aid. Each of the provinces and territories has criteria with respect to who may qualify for criminal legal aid. There are differences, but there's a general common denominator: if the result of the conviction would be imprisonment, then the person's entitled to legal aid, subject to income criteria, which vary from province to province.
The federal government does not provide money directly to the provinces for civil legal aid. However, through the Canada social transfer system, it provides grant funding to the provinces, and they're able to use that money for civil legal aid. The types of civil matters provinces would be willing to fund are subject to provincial criteria. Generally, it has been in areas such as family law and certain poverty issues. There is also legal aid available for some immigration matters.