The fill valves are pretty much universal (for most brands), so yes, I think it would work. But, depending on the valve that is there, sometimes all it takes is a new seal for a buck or so.
A completely new valve is less than $10, so it is your call. Many of the new Totos use the Korky Quietfill valve. If you replace it, make sure to adjust the water level per the instructions.