If a player from Team A is injured and is being substituted, can Team B also substitute at that time?
If so,is there a limited number of players that can be substituted?

Answer (November 18, 2014):
Q. 1: Yes.
Q. 2: See below.

Under the Laws of the Game, the following procedures apply:

Substitution procedure
In all matches, the names of the substitutes must be given to the referee prior to the start of the match. Any substitute whose name is not given to the referee at this time may not take part in the match.
To replace a player with a substitute, the following conditions must be observed:
• the referee must be informed before any proposed substitution is made
• the substitute only enters the field of play after the player being replaced has left and after receiving a signal from the referee
• the substitute only enters the field of play at the halfway line and DURING A STOPPAGE IN THE MATCH
• the substitution is completed when a substitute enters the field of play
• from that moment, the substitute becomes a player and the player he has replaced becomes a substituted player
• the substituted player takes no further part in the match
• all substitutes are subject to the authority and jurisdiction of the referee, whether called upon to play or not

And from the back of the book, under Interpretation of the Laws of the Game and Guidelines for Referees, Law 3:

Substitution procedure
• A substitution may be made only during a stoppage in play
• The assistant referee signals that a substitution has been requested
• The player being substituted receives the referee’s permission to leave the field of play, unless he is already off the field of play for reasons that comply with the Laws of the Game
• The referee gives the substitute permission to enter the field of play
• Before entering the field of play, the substitute waits for the player he is replacing to leave the field
• The player being substituted is not obliged to leave the field of play on the halfway line
• Permission to proceed with a substitution may be refused under certain circumstances, e.g. if the substitute is not ready to enter the field of play
• A substitute who has not completed the substitution procedure by setting foot on to the field of play cannot restart play by taking a throw-in or corner kick
• If a player who is about to be replaced refuses to leave the field of play, play continues
• If a substitution is made during the half-time interval or before extra time, the procedure is to be completed before the second half or extra time kicks off

As you can see from these quotes, there is no limit on the number of players that may be substituted. However, remember that this particular facet of substitution was not written to consider the system of multiple substitutions that we see in many competitions.