After reaching the very first Pokemon Center, the QR Scanner will be added to the field menu (you may need to toggle the page with L/R if it's on the second page). This will open up a new screen where your cameras will turn on and you will be instructed to scan a QR Code.
Every Pokemon in the Alolan Pokedex has a QR Code, except those with the following Pokedex numbers:
Special Pokemon: 203, 204, 205, 285 to 302.
QR Codes are different for different gender, forme, and shiny variations as well. Scanning a QR Code will unlock Pokedex info if you don't have it yet, but only Pokedex info for seen, not caught. This can be helpful for plugging a few holes in your dex so that you can see where everything is.
Each time you scan, you'll earn 10 points, 20 points for scanning special QR codes, like the one for Mythical Pokemon Magearna. Once you've scanned 10 times max, or earned 100 points, whichever happens first, you'll unlock a neat feature called Island Scan.
Don't be Greedy!
Note that you can't keep scanning QR codes endlessly. You can scan up to 10 QR codes in a single session; after scanning a QR code, you will have to wait approximately 2 hours for each individual scan to recharge. Therefore, you can only feasibly perform 1 or 2 Island Scans per day.
After acruing 100 points, press and hold the R button while on the QR Scanner screen to scan the Island you are currently on. Once the scan is complete, a rare Pokemon not in the Alolan Pokedex will be detected.
Go to the area it's telling you to and run around in the grass or wherever you need to get wild Pokemon to spawn, and eventually you'll encounter the Island Scan Pokemon, which you can then catch.
The Pokemon you'll get is dependent on two factors: the island you are on, and the day of the week. The following table lists the Pokemon you can find on each day in each island. Fly to the island using Charizard Glide to control the Pokemon you want in a given day.
Island Scan will only last for one hour, but that should be more than enough time for you to locate and catch the Pokemon. If you don't manage to catch it within the hour, all you can do is scan more QR codes and try to catch it again later. Possibly next week if you missed the window of opportunity...
Plain ol' Rare Pokemon
By the way, Pokemon that appear from Island Scan will not SOS chain and, sadly, can never have their Hidden Abilities.
The very first island is home to the Johto starters, which is sure to delight fans of Gold, Silver, Crystal and the remakes. Deino is another notable Pokemon, which eventually evolves into the devastating Dark- and Dragon-type Hydreigon.
An odd mix of Pokemon await on Akala Island. Honedge eventually evolves into the extremely versatile Aegislash, which can swap between defensive and offensive modes on the fly. Marill is another highlight; with Huge Power, it's a force to be reckoned with.
Ula Ula Island
Ula'ula has a bunch of rather odd-ball Pokemon, some of which are in their middle form. None of these Pokemon really scream "must-have", but at the same time wouldn't be out of place in an experienced trainer's party.
All the Island Scan Pokemon in Poni Island are fully evolved--and even include the starter Pokemon from the Unova titles! Fans of the 4th and 5th generation games will be right at home here.
Don't even bother trying to change the 3DS clock to try and get more scans or to skip ahead to a day with an Island Scan Pokemon that you want. Doing so will freeze your timer for a while or reduce your number of scans to zero.
Although, if you're smart, you could try skipping ahead to the day before the Pokemon you want. Still, it's a bit of a hassle and it could impact other time-related events. For other games you own as well, not just Sun and Moon.