A Pokemon can always have perfect IVs.
Wild Pokemon as well. Any number of perfect IVs, but it is based on luck.
However, I have found something about chains affecting IVs, but I am not sure if it's true since it isn't official(it is tested though).
The higher the chain, the higher the number of perfect IVs. Sadly you can only get 3 guaranteed perfect IVs like this.
As you can see, up to a chain of 20 you will not have any perfect IVs guaranteed. From 21 to 40 you will have one, 41-60 you will have two and from 61 onward you will have 3 guaranteed perfect IVs.
Since you had your chain around 45, you were guaranteed 2, and got the third one by luck.
Hope I helped.