If i have a rainbow energy in my hand.Could I attach it to one of my Pokemon via Feraligator primes rain dance poke power without it counting as my attachment for the turn?
It says right on Rainbow Energy that while not in play it's a Colorless Energy. So you can't use it for Rain Dance (and other Powers like Pachirisu's Self-Generation for instance).
Adding to that answer, if you use Rain Dance to attach any {W} Energy from your hand, it doesn't count as the 1-per-turn attachment, since you are using a card effect to do so. The 1-per-turn rule applies only when you are not using an effect.