They may "work" but unlike hard disk drives there are unique concerns that apply to SSDs. One might, for example, require a firmware update for which the manufacturer supplies installers that will only work on Windows PCs.
The only aftermarket SSDs I have used and can recommend are sold by OWC / MacSales, and of them I have only used the ones with a five year guarantee. The oldest of them are now older than that and I have never experienced a problem with any of them.
Certain SSDs may work well initially but will fail or become so slow as to be unusable when they reach a certain time in service. Samsung SSDs for example have a generally poor reputation among Mac users. Complaints regarding Samsung SSDs are commonly reported on this site whereas OWC's have literally none.