Countries split sharply on this. Some allow in-country status changes, letting you convert from tourist to student or certain work categories without leaving. Many others explicitly forbid it, requiring you to exit and apply from your home country, precisely to stop people arriving as tourists and job-hunting or enrolling afterward.
Even where conversion is possible, conditions apply: you need the underlying approval first (an admission letter, an employer-sponsored work permit), your tourist status must still be valid when you apply, and some countries treat applicants who seem to have planned the switch all along as having misrepresented their purpose on entry.
So the safe sequence: research the specific country's rules before travelling, and if your real goal is study or work, apply for that visa from abroad whenever the rules require it. Where in-country change is allowed, apply early, keep legal status throughout, and use official immigration channels rather than agents promising shortcuts.