Strictly speaking, you are normally expected to work through your notice before leaving the company. However, in many cases, either you or your employer will want to cut short the notice period so that you can leave more quickly.
From your standpoint, once you've given notice you may be so excited that you want to join your new company as quickly as possible. Alternatively, you may detect some resentment toward you and feel that it is better to complete the handover process immediately so that you can go.
Conversely, your employer may not see you as a team player any longer or in certain situations, feel that it may affect the morale of the remaining staff if you stay. In this scenario, you will soon be asked to leave the office more quickly.
Regarding salary, the general (although by no means universal) rule is that if you ask your employer if you can leave before your notice is up, you should not expect to get paid for the part of your notice you don't serve. It follows that where your employer asks you to expedite your departure, they would have to pay you for the full notice period. Remember though, that this is a general rule only and you will have to refer to your own contract to confirm this.