In some openings, like Nimzo-Indian, the usual e-pawn move is e3, while in openings like the KID, White can play e4. Is there some guidelines to know when you can play e2-e4?
In the Nimzo-Indian, Black's entire opening strategy is built around restricting the e4 push. 1... Nf6 stops it immediately. 2... e6 prepares 3... Bb4, which stops it again. Black's takeaway from the opening is that white is generally only able to achieve e4 by making some concession.
In the King's Indian, Black makes no attempt to stop the e4 push other than 1... Nf6 which is of course only a temporary delay. 2... g6 and 3... Bg7 are both aimed at d4.
So, you can tell when you can play e4 by looking at the idea of Black's moves.
Besides knowing the "why" of the variation you are playing rather than the "what" to play in each position, that is, prioritizing concepts to line memorization, I would say that an easy way to check when a push is favorable or not is by analyzing whether the position has benefited from it or not.
It is extremely important to know and understand what white and black are trying to do in the opening. This general ideas may be such as "winning queenside space", "developing quickly", "impeding the e4 push", "impeding the d4 push", "pressuring the e4 square" and many more are what, in general, guide the player to the making of certain moves above others.
If you have not a general idea about the opening, then the easiest way to see if a push is all right is to see if it has no tactical or positional drawbacks. If with your push you are losing a pawn, then it's probably not the best option. If with it you are threatening to win a huge amount of space on the center and cramp the other's position (and no tactical drawbacks arise) then probably it not only is a playable move, but a good one too.