Maybe, depending on the exact model of the Mac. Some laptops have speakers that are removable, while others are glued in. Even some of the removable speakers are not that easy to replace. Some speaker connectors on the Logic Board may pull from the Logic Board permanently damaging the connector on the Logic Board, while some may non-touchbar models may have the studs come loose which are extremely difficult to reinstall the tiny stud without stripping the threads. Some laptops require the Logic Board to be removed which means there are a lot of opportunities to damage the Logic Board and cables/connectors. More than likely you will only receive a used speaker, so the older the laptop the more likely the used speaker you purchase will be nearly worn out and have terrible and/or weak sound.