Memory is memory
Definitely not true hardware-wise. L2 cache is different from DDR3 RAM is different from DDR4 RAM... in price and performance
Software-wise, yes, the operating system abstracts away the differences and memory is memory
Apple's memory upgrade costs are probably 90% usual Apple bullshit pricing, 10% grounded in reality. I'm thinking that the 10% may be something like the motherboards are designed without memory upgrades in mind, so if you want more RAM, they have to use a special mobo which they prefab less of