Yes, it is allowed, but it depends on the rules of the tournament. For example, this was the rule for the 2010 World Cup:
Article 26.4
The final list of not more than 23 players (showing the full last name(s), all first names, popular name, number on the shirt, position, place and date of birth, passport number, club and country of the club, height, weight, number of caps won, number of goals scored) shall be submitted to the FIFA general secretariat, using the official form for this purpose. Only the numbers 1 to 23 may be allocated to these players, with number 1 being reserved exclusively for one of the goalkeepers. The shirt numbers for the remaining two goalkeepers may be any of the numbers between 2 and 23. The numbers on the back of the shirts shall correspond with the numbers indicated on the final list. Only these 23 players (except in cases of force majeure recognised by the FIFA Organising Committee) will be permitted to compete in the final competition.