Question about installing SSD into a Macbook Pro
You can restore the backup onto the SSD so long as the SSD fits the entire contents of the backup[1].
According to Apple's support pages, you do not need to use an Apple Time Capsule for backups:

Time Machine is the built-in backup feature of your Mac. To use it, you need an external storage solution, sold separately:

External hard drive connected to a USB, FireWire, or Thunderbolt port on your Mac
Time Capsule or macOS Server on your network
External hard drive connected to the USB port of an AirPort Extreme Base Station on your network


Then you would want to restore using macOS recovery using the &quot;Restore from Time Machine Backup&quot; utility.
[1]: It's possible this is not the same as the size used by your hard drive, as the Time Machine backup also has previous versions of files and deleted files. However, since you are newly setting up Time Machine, there would be no previous versions of files.