“Getting the sack” has come to mean getting fired or dismissed from anything, including a love affair.
The expression entered the language long before the industrial era, at a time when workers carried their tools from job to job in a sack.
When the job was done, or the laborer was discharged, the boss or employer would simply hand the worker his tool sack.
He was literally “given the sack.”