You can use a self-directed IRA or 401k for real estate investing. However, you would NOT be able to live in--or personally benefit from--the real estate itself (except as an investment). There's essentially an iron wall between your use of the funds (as an investor) and your personal use.
Here are some companies that offer self-directed IRAs. Most/all also have extensive information on their sites about what you can--and can't--do.
Hope that helps.