I used to use a desktop to work, but I use a laptop now. My desktop has a SSD, so I am planning to format it and use it with my laptop. Then I got a question. Is it okay to just replace my laptop hdd to sdd without formatting?
If you mean take your desktop HDD and put it in your laptop... It might function, but I wouldn't recommend it.
Your laptop might have a different architecture than your desktop, and obviously all your laptop specific drivers would be lost.
You should be able to stick the SSD drive in and reinstall using the manufacturer's CDs, or do a fresh windows install, but as far as just throwing the new drive in and being good to go, I don't think that will happen.
If you want to replace your laptop HDD then I recommend bringing it to the service and have them change it. They will also tell you if your SSD is compatible with your laptop or not.
For the question if it will work without reformatting, it depends on what OS you use. Linux usually doesn't mind if you change the platform beneath it, but Windows probably won't work, so you will have to reinstall it. Of course if you have your data files stored in a separate partition (which is recommended), then you don't need to reformat that one, only the system partition.