As per aiims pg eligibility there's
- no limit on the number of attempts permitted to clear the aiims pg entrance examination, also
- it does not mention any upper age limit for the candidates appearing for the examination.
Now , since there's no attempt limit and age limit , you can appear and write aiims pg entrance entrance examination as many times as you want ,
But yes you should try to qualify it in the very first or second attempt itself.