Of course you can calculate a rate of return for a given individual’s Social Security contributions and benefits. You can calculate a rate of return for any series of cash inflows and outflows.
However, you won’t get a definitive answer for any given individual until that person is dead. Until then, you don’t know for sure how much benefit they’ll collect. And of course, until a person retires, you don’t know for sure how much they’ll contribute.
For a living, working person, you can only calculate an expected rate of return based on various assumptions–how long the person will work, how much they’ll earn, whether Congress will raise taxes (eventually, they’ll have to), how long the person will collect benefits in retirement, and how much those benefits will be (benefits vary with inflation, and Congress can change the law at any time).
A given individual’s expected rate of return varies based on longevity, income, and family status. Longer-lived groups (women, white people) enjoy higher (not high, but higher) expected rates of return. Shorter-lived groups (men, African Americans, smokers) enjoy lower rates of return.
Lower-income individuals enjoy higher rates of return, because there are redistributive elements to the benefit formulas. Higher-income individuals enjoy lower rates of return.
Persons with non-working spouses enjoy higher rates of return, if you count the survivor benefit as part of their benefit. Persons born earlier in time enjoy higher rates of return, because they paid SS taxes at a lower rate while they were working. For very young people, the rate of return is especially uncertain because their benefits may one day be drastically reduced (with fewer working-age people, the taxes won’t be there to pay them).
In general, averaging out for the above variation, SS rates of return for people born after 1950 are poor relative to other investments, because it’s structured as a pay-as-you-go program where a diminishing number of working people needs to support a growing number of retirees. Here are some figures.