Yes. 401(k) plans can be eligible shareholders of an S corporation because they are exempt under §401(a) [§1361(c)(6)]. IRAs cannot be eligible shareholders. 
Practically speaking however, having a §401(k) plan as an S corporation shareholder is generally a poor choice and the S corporation may want to consider revoking the S election. 
The problem is that pass-through income from an S corporation is considered unrelated business income (UBI) to the §401(k) plan [§512(e)]. This means that the §401(k) plan is required to file Form 990-T and report the S corporation income on Line 5. UBI is taxed at trust rates (i.e., 39.6% bracket for taxable income over $12,150 in 2014) since the §401(k) plan is a trust.