The epidermis, the outer layer of the skin, is comprised of both living and dead, keratinised tissue. Here is a link to Leeds University histology department describing the structure of epidermis (https://www.histology.leeds.ac.uk/skin/epidermis_layers.php).
You are right to say that keratinised epidermis ("dead cells") are a vital part of the protective mechanism of the skin. However, many people find that excessive keratinised skin is not desirable for comfort, aesthetic or practical reasons. Callous (callus) formation at sites of pressure and friction is probably the most common example and many people will use a pumice stone, file or blade to remove excess skin.
Removing callous and keratinised skin will not necessarily render one vulnerable to infection provided there remains enough of a covering to maintain a protective barrier. With regard to "fish pedicures" by the "Doctor fish" Garra rufa there are isolated case reports of infections or risk:
- https://www.ncbi.nlm.nih.gov/pubmed/28677579 - mycobacterium infection
- https://www.ncbi.nlm.nih.gov/pubmed/24771416 - S. aureus infection
- https://www.ncbi.nlm.nih.gov/pubmed/23460407 - MRSA infection
- https://www.ncbi.nlm.nih.gov/pubmed/22608013 - presence of zoonoses
However, there is no epidemiological data to provide an estimate of risk.
The Health Protection Agency (HPA) of the United Kingdom has published recommendations on fish pedicures:
"On the basis of the evidence identified and the consensus view of experts, the risk of infection as a result of a fish pedicure is likely to be very low, but cannot be completely excluded."
But does suggest:
"Certain groups of clients such as those who are immunocompromised or have underlying medical conditions including diabetes and psoriasis... ...are likely to be at increased risk of infection and fish pedicures are not recommended for such individuals."
So, overall we can probably say that there is little risk associated with fish pedicures and it is likely comparable to other forms of keratinised skin removal.