A pension is considered "unearned" income, although still taxable (just like investment income is considered "unearned"). To contribute to a 401k, you must be employed (or self-employed) & the business must sponsor the 401k plan. To contribute to an IRA, you (or your spouse) must have EARNED income equal to or greater than the IRA contribution.
If you only have unearned income (pension, investments, real estate, royalties, etc.), unfortunately you can't contribute new money to an IRA. However, you are able to convert traditional IRAs/401ks to a Roth IRA, if desired.