No; mods have to be rewritten (or at least recompiled) with every update, even minor ones, because the class files are obfuscated differently each time (that is, they are given names like aaa, aab, aac, and so on, to hide the original names), so if you tried to use it in 1.7.4 you'd end up overwriting the wrong files, crashing the game, or at the least, Optifine wouldn't work.
I want to say that chunk loading is handled differently in 1.7.4 then 1.7.2, and as optifine deals with that it shouldn't work. However I don't think it works in exactly the way you put it as there were plenty of mods that work identically in both 1.6.2 and 1.6.4.
I think you are talking about Forge mods, because the obfuscated class names are indeed different in 1.6.2 and 1.6.4, having modded the game myself; for example, MapGenCaves is aep in 1.6.2 and aeq in 1.6.4; similarly, for 1.7.x it is api in 1.7.2 and apn in 1.7.4; even trying to rename one to the other wouldn't work because they internally reference other classes. Optifine is made by using the base classes, so it wouldn't work in any case.
I really want shaders but can't do it until i get optifine.
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
I think you are talking about Forge mods, because the obfuscated class names are indeed different in 1.6.2 and 1.6.4, having modded the game myself; for example, MapGenCaves is aep in 1.6.2 and aeq in 1.6.4; similarly, for 1.7.x it is api in 1.7.2 and apn in 1.7.4; even trying to rename one to the other wouldn't work because they internally reference other classes. Optifine is made by using the base classes, so it wouldn't work in any case.
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?