It depends what do you mean with "stock Android" you two didn't understand each other I think. I'll explain you how some things work so you can understand what's going on:
It's about how you define "stock Android" if by stock you mean the one shipped with phone (Samsung, LG etc.) or you think on pure Android aka AOSP. The stock Android is placed on nexus/pixel devices Motorola and few others, other manufacturers use Android but the add something their theming and such things (Samsung - TouchWiz, Huawei - emui and so on..) so it's stock on that phones. So if you take any rom of Samsung and try to install it on any other phone you will fail. Android is just a system it needs drivers so it can communicate with hardware, it's not like on PC where you install OS and then search for drivers (until windows 7, linux is some other story). Android ROM is like it Windows XP is made for only one configuration for example "x" cpu, "y" gpu, "z" hard disk and also particular manufacturer and it won't work if there is "w" cpu instead of "x". With custom ROMs things go like this: lineage os provides source code for operating system and other users who may or may not have contributed to making lineage os are providing so called "device trees" and kernel source code (published by phone manufacturers but sometimes needs some changes to make things work, also unique for every model of phone so one can't be used in two or more different models), so lineage os source code, device tree, and kernel sources are used to make rom - compile it for particular phone model, there are also proprietary files which are files used by some hardware but it's not open source so you need to extract it from phone. So no rom can be used on two or more different models even if are they from same manufacturer.