Generally speaking, there aren’t a lot of instruments that are so tailored to secular music that they cannot be used at Mass. An organ, for instance, can be played in a style suitable for a cathedral or suitable for a ballpark. Those are two very different styles of composition, but an organ can do both. A violin can obviously do very different styles of music. An acoustic guitar can, too. An electric guitar, not so much. Certain percussion instruments used judiciously–maybe. A drum kit, not so much.
Those who object that it is difficult bordering on impossible to play a guitar in a style appropriate for sacred music in a large space (tailored to a pipe organ) without essentially getting the effect of singing a capella are not entirely wrong (although that is less true when there is judicious amplification). Having said that, there are churches that are small enough and have the acoustics such that guitars playing as part of a group can work.
On top of that, there are churches that were not built to accomodate a pipe organ. Obviously, an electronic organ is as much a part of the “rock sound” as a guitar. It depends on the style of the composition and the playing. If the composition is appropriate for sacred music, the style of play is appropriate for sacred music and the guitar or the ensemble matches well with the space, though, a guitar can be suitable for sacred music. It is also not unusual that the only suitably-trained musicians a parish can find play the guitar, not the organ.
I would point out that because the organ repertoire has been expanded from church music to include opera, rock and even ballpark music, even the organ has to be played in an appropriate way to be right for sacred use. There are instruments that can’t be tailored for sacred use but there are no instruments that cannot be played in a way that is wrong for a sacred setting. It is even possible to go wrong with an organ.