Yes, they both are correct. But when you say i know it pretty well, you are saying that you have quite a good idea about something, little chance then to be wrong. On the other side, when you say that you know perfectly well, then there is no chance to be wrong!