Section 45(2) applies when Capital asset is converted into stock in trade. Now see as per Section 2(14) capital assets means inter alia property of any kind held by assessees, whether or not connected with his business or profession.
Means for example any company has held some assets as Investment say Building and later on it starts dealing in buildings and then convert its investment into stock in trade then it is clearly possible for companies as well.
So in my opinion it is applicable for any Assessee.