You can only apply for a work permit from inside Canada if:
- you, your spouse or parents have a valid study or work permit,
- you have a work permit for one job but want to apply for a work permit for a different job,
- you have a temporary resident permit that is valid for six months or more, or
- you are in Canada because you have already applied for permanent residence from inside Canada. You will have to pass certain stages in the main application process before you can be eligible for a work permit.
There are other requirements as well.
If you are already in Canada as a visitor, you may not apply within Canada. You must apply for a work permit at a Canadian visa office responsible for the country where you live.
If you want to work permanently in Canada, I suggest you apply to a worker visa since the beginning. You can check federal and provincial programs to hire foreigners, but it is not as easy as you might have been told. Each program has its own restrictions, you can check in the CIC web site if you are eligible for temporary foreign worker program, or the international mobility program, which I think are the most common.