>>13815049In theory, the Samuelson condition just uses math to describe what should be optimal (marginal benefit equals marginal cost). It's valid for any utility function and any production function that satisfies a number of conditions (differentiable, increasing, concave, etc.). So long as we can verify these properties for the functions approximating human behavior and economic output, it's applicable in real life.
An increasing utility function captures the idea that a person prefers having more to less and a concave utility function captures the idea that someone more deprived enjoys consumption more (i.e. a poor person values a dollar more). These are reasonable preference assumptions which can be tested.
An increasing production function captures the idea that more inputs leads to more output. A concave production function means there are no economies of scale. This latter condition may seem debatable (can't bigger firms be more efficient?), but we're talking about the production function as an economy-wide aggregate. We can figure out whether a concave production function approximates the way the real economy behaves or not.
Of course, the assumptions underlying economic models are always up for debate, which is why economics is not settled science and new research is still being published. In numerical exercises, we can choose a utility function and a production function that adequately approximates human behavior and economic output. Which utility functions and production functions are appropriate is one of the many questions economics may try to answer.