Anyone who plans to visit Canada must apply from outside of Canada before they travel.
What your friend or family member needs depends on:
the type of travel document they will travel with;
the country that issued their travel document;
their nationality; and
how they will travel to Canada.
Before applying, find out what document(s) they need.
If they need a visitor visa, you may provide your family member or friend with a letter of invitation in support of their visa application. A letter of invitation can help, but it does not guarantee the person will get a visa.