Good news, your wish is granted (to a certain extent): the Dutch company Fairphone sells a modular mobile phone whose parts can be swapped for repairs and upgrades. Check their latest products at https://www.fairphone.com/en/ .
Modular laptops on the other hand are not really a thing. There are reasons for that, most notably cost - as laptops are highly specialized devices, nowadays they are engineered for mass production on a compact footprint and interchangeable parts doesn't bode well with cost. Your best chance is a laptop which is designed to have certain parts upgradable but, even then, it's mostly a one time thing. Check https://www.netbooknews.com/reviews/best-upgradeable-laptop/ for reference.