Yes, it is possible for someone to install spyware on your Mac. If you are concerned that this may have happened, there are a few steps you can take to check for and remove spyware.
First, check for any unusual or unexpected activity on your computer. This could include new programs that you didn't install, strange browser activity, or unexpected changes to your system settings. If you notice anything suspicious, it's possible that spyware has been installed.
Next, run a virus scan using a reputable security program. This will check your computer for any malicious software and remove it if found.
Finally, keep your Mac up-to-date with the latest software updates. This will help to prevent spyware from being installed in the first place.