yes, you can have visitors on your island - up to 8, actually. you can invite people through online or local (offline) play by talking to orville (the dodo bird working on the computer at the top right corner when you enter the airport) at the airport counter - all airport services are available to the player on you second day of the game, and tom nook will let you know of this. when you choose to play online, you will be given a code called "dodo code" that you can send to people - they will use that code at their airports to fly to your island.
the same procedure works if you want to visit someone else's island, either online or through local play. if you choose to play online and someone has shared with you their dodo code, tell orville that you have one and he'll ask you to input it.
the same code will work as long as you are online - if you go offline by pressing the power button, for example, your airport gates will close and you'll need to talk to orville again to get a new dodo code. while your gates are open, you can have them closed by speaking to orville at the airport or pressing the minus button on your switch.
the dialogue with orville is pretty intuitive - he'll tell you everything you need to know. hope this helped a little bit!