Is computing majority element while doing secure two party computation for inner products ( input of the two parties ) an attack on the protocol? This was told to be an attack.

However, we can create a simulator in the ideal world which sends all 1s to the trusted party and receives the number of ones of the honest party. Is this simulation correct?
As shown in the attack you described, computing the majority bit is not an attack in the malicious model. However, it is an attack in the semi-honest model.