Put a preinstalled macOS SSD to another MacBook, will this occur any problem? I hope you're doing well.

I have 2 MacBook Pros, different models, same size 15", 2010 and 2012. The 2012 one is suddenly dead and I have removed its SSD and put it into the 2010 one (HDD on 2010 is also removed). After then, I turned on the 2010 MBP, it works like a charm. There are still some minor weird activities: asks me to login again to iCloud, Firefox new addons popup, Photoshop warning about VRAM... but most of the system is working smoothly.

So my concern is, will the SSD change occur any problem later? Can I do a Time Machine backup without any damage in the future? Thank you for any help.
No, you should never experience problems with this. There will never be any damage from this kind of transfer or by doing a time machine backup after the transfer.

That said, depending on which apps you use, some apps and app licenses may have been tied to hardware information such as the old computer's serial number. I'd recommend using migration assistant from a time machine backup of the 2012 computer to make sure you don't have a problem with these licenses.