Scheduling index rebuild jobs
You should use smart index maintenance scripts as opposed to maintenance task.


  Should I run the job in primary or in replica? 


Yes, as they get replicated on secondary replicas.


  If I run it only on secondary then what benefits do I get?


you cannot run on secondary replica.

Index maintenance generate a lot of transaction log activity that affects your RTO and RPO. Also, it increases the redo backlog on secondary replicas.

You should follow Recommendations for Index Maintenance with AlwaysOn Availability Groups :


Find a quiet time or during planned maintenance time run your index maintenance.
If possible switch from Synchronous mode to Async mode. Once index maintenance is done, switch it back to what it was.
Take frequent log backups so that the log file does not grow out of control.
Since you are on sql server 2014, you should use WAIT_AT_LOW_PRIORITY, MAX_DURATION, and ABORT_AFTER_WAIT 
If you are using online index rebuilds, then use MAXDOP = 1


Also, note that a Partitioned Table May Limit the Runtime MAX DOP of Create/Alter Index


  Is corruption likely to happen if I use SP1 and index rebuild via maintenance plans?


Since you are on SP1 (12.0.2370 or greater) , you should be fine.