I think it is unlikely there was any harm done.
But, if you were in the middle of copying some files, or had your system running, and accidentally shut off your Mac (or just pulled the power plug), then that could cause some problems very quickly. But, probably not while you are booting the system.
If you want to make sure, I would suggest that you shut down completely (so your Mac is OFF, and a normal power off) then restart while holding the Shift key. That will boot into Safe Boot mode. Your Mac will perform a few self-tests during boot that it does not normally do, and it can take several minutes to get to your login screen. You will log in, even if you have your system set to automatically go to the desktop. You are in Safe mode, so your video will look a bit different, and some parts of your system don't load.
When you are at your desktop - your next step should be a restart. That will get you back up adn running your system as you normally expect.
No errors? No problems? You should be OK --- (Press and release your power button. Don't hold the power button, unless you have a good reason for doing that

)