Counting frames has to do with the framerate that the game is running at, but for modern 3D games it is a little more complicated than that because the mechanics of the game and the visual output of the game are not necessarily tied together. Since most games run at 30 or 60 frames per second, the math is pretty easy.
Take a 2D fighting game, like Street Fight 3, which runs at 60 FPS, since it has a parry mechanic. Let's say Ryu has a punch that takes 10 frames of animation or 10/60ths of a second, and 1 of those frames is parryable. An extremely good player might be able to "count" those frames and get what would in this case be a frame perfect parry, but a realistic person can't react to a 1/60th of a second window on demand. I have no idea what any move frame lengths or parry windows are in SF3, this is all hypothetical. But when you hear speedrunners or someone mention a "frame perfect" trick, that means they have 1 frame out of whatever the FPS of the game is. And speedrunners can never seem to do those consistently.
But let's look at a game like Bloodborne, which I believe runs at 30 FPS (or maybe 24?). For simplicity's sake lets assume a boss or big enemy is attacking you, and that attack will hit your location no matter what. Kind of an unrealistic example but you don't have to worry about location changes. The boss does a big wind up move and it's gigantic arm is coming straight toward you. Let's say in the window between where it would enter your hitbox (the head) and leave your hitbox (the feet) there are 5 frames that where damage could be counted. But if your dodge has 10 iframes, you have a leniency to avoid damage that is twice as long as the attack could potentially damage you.
1 - Attack incoming, begin iframe window, iframe 1
2 - Attack incoming, iframe 2
3 - Attack incoming, iframe 3
4 - Attack in hit box frame 1, iframe 4, no damage
5 - Attack in hit box frame 2, iframe 5 no damage
6 - Attack in hit box frame 3, iframe 6 no damage
7 - Attack in hit box frame 4, iframe 7 no damage
8 - Attack in hit box frame 5, iframe 8 no damage
9 - Attack over, iframe 9
10 - Attack over, iframe 10
As long as your iframe window begins at or before any damage calculation and ends at or after any damage calculation, you've successfully rolled. So using my example above you need to mitigate an attack that takes 1/6th of a second but you have 1/3rd of a second do it.
But like bucky said, nobody is really counting frames in BB. The window for iframes is big enough that most people can reasonably dodge most attacks. But you still have to get used to how early or late you can get away with it. If you dodge as soon as an enemy's hand twitches, you're probably going to get hit.