When firing yes, when quitting probably not
I've heard of people trying to do the same to people who voluntarily resign. Just a quick reminder that doing this is pointless and stupid. If someone is quitting they will obviously know before you do and if you have a regular habit of escorting quitters out the same way you kick out fired people then you can guarantee they already know how you will behave. Save yourself some organisational memory and don't burn that bridge. If someone tells you they are quitting then lock them out on their last day not before.