The rules will vary from site to site and also from casino to casino.
The rules will also vary within the same poker room (Online or B&M) depending on the type and size of a game.
There are two basic scenarios for getting in a game, a player is required to post a blind or the players is not required to post a blind.
If the player is required to post a blind to receive their first hand the blind size will be the size of the big blind. The player usually has the option of waiting to post the blind until it is their big blind, and sometimes they can even pass the big blind and wait to post behind the button.
If the player is not required to post, in some places they can wait to play their first hand until the button has passed them, or the rule may be that the player assumes all obligations of the seat, they can pass a hand but they will still be obligated for the blind just as though they were already dealt in.
The question about why have the rules at one end and not the other is kind of silly. You can come and go as you please in a poker game. Coming into an existing game has some rules because people playing believe that they paid for the position they are in and a player sitting in behind them dilutes the value of their position, which is true. So depending on the game and the sophistication of the players, rules have developed so new players cannot gain a positional advantage without some cost. Or not. When a player leaves, whenever he leaves they have already played blinds for the rounds they have played and gain no positional advantage when they leave. You can if you run your game make a rule that players cannot leave unless they leave on their blinds are post a blind on their last hand.