Yes, you can work in Sweden with a residence permit, but only if your residence permit explicitly allows you the right to work, such as a work permit. A general residence permit does not allow you to work; you must also have a work permit from the Swedish Migration Agency (Migrationsverket).