While a visitor can now apply for a work permit from within Canada, many individuals still go to the border to apply.
This should only be done if you and/or your representative have done the homework and ensured that all relevant t’s are crossed and i’s dotted.
A relatively recent case discusses the risk inherent in approaching the border as well as allegations of incompetence/negligent representation (and perhaps conflict of interest?) by the applicant’s former representative:
 This application challenges a decision made by an Immigration Officer [Officer] on July 29, 2020 to issue an Exclusion Order against the Applicant, Cajetan Enye. It is common ground that, when Ms. Enye attended at the Douglas border crossing, she was out-of-status. Her intention was to attempt to regularize her immigration status with the assistance of her immigration consultant. Things did not proceed as planned and instead of receiving a visa, she was given an Exclusion Order. Although Ms. Enye remains in Canada, she does so under the risk of immediate removal.
 Although it is not a point of contention, it bears stating that the Officer’s decision was lawful and reasonable based on the information provided. When Ms. Enye and her consultant appeared at the border, they were“flag poling”, which is a euphemism for re-entering Canada after briefly reporting to the United States authorities. Ms. Enye’s immigration status as a student had lapsed about eight (8) months earlier and, despite some ongoing efforts on her part and that of her employer, she had not managed to regain status. Ms. Enye blames this lack of success on the immigration consultant she had engaged on the advice of her employer. It appears that the consultant was actually retained by the employer at least in the sense that his fees were being paid through deductions from Ms. Enye’s wages (see Applicant’s Record at page 68).
 I am satisfied on the record before me that the requisite level of professional incompetence has been established and that, had the consultant taken timely and appropriate steps, Ms. Enye would have reacquired her status. She was, after all, working in a nursing role and had an employer that had sought to employ her under an approved Labour Market Impact Assessment.