No, racks are to all intents and purposes generic. It is a rare bike frame that has no rack bosses on it, and those bosses are always threaded for standard M5 screws. The rack may want to use a single center mount to the seatstay bridge, or ideally the frame has more M5 bosses on the seatstays themselves. Or you can use a seat clamp that has a pair of 'ears' that are M5 threaded themselves. I have used all of the above.
If you are not so handy at fitting on a rack to your frame, you can go to a user group for your brand of bike and ask, but really... the fitment is generic and the many aftermarket racks out there are adjustable specifically so they can take advantage of those expected frame bosses and still go longer or shorter to match that frame. Not to be deliberately contrarian, but fenders are pretty much the same. It all depends I guess on whether you care to adjust the aftermarket kit to fit or you want to buy what the manufacturer is selling. There are of course exceptions to this. But only the funkiest of funky frames can't be worked with, even for fenders.
As to the electrical bits, that answer can vary widely. Sondors ebikes were highly prized for their use of more or less open market parts which made them easily upgradeable. It was common to take one of their Original fat bikes, and pull the 350w motor core, plug in a 750w core, then remove the 15a controller and replace it with a 35a controller. And top it off by selling the original 36v battery to offset the cost of the 52v battery you fit into the triangle. Not so common was doing the same thing with 60v parts which made a pedelec capable of 40 mph. BUT many ebikes are not so easy to play around with. This is where you need to nose around the user groups for your chosen ride and see what if anything is possible. This is another reason why DIY is popular with more mechanically minded riders. Its easy to build something more capable and less expensive if you take the time to learn what you are doing and have a decent background as a home bike mechanic.
Lacking the latter, you can create a real monstrosity so for some people a much better option is to write a check and leave the bike building to people who know enough to do it right.