Yes rats can get into coffins especially those coffins that are made of wood.
I remember helping exhume a coffin about 10 years ago when I worked with the cemetery and when we opened the coffin to look at the body there were 3 rats hanging around in the coffin as they had gotten into the ground deep down in the ground and chewed through the wood coffin.
In a metal coffin the rats are less likely to get into the coffin but they still might be able to get through the seals that seals the lid to the coffin.
Insects can also get into the coffin through those seals and also a wood coffin will eventually rot overtime and then insects and rats and other rodents etc can get into the coffin to the body.
The body will eventually decay even with use of embalming chemicals.
It's rare that rats and other rodents get into coffins but they do sometimes do.