Yes struggle will hit any Pokemon type no matter if it's a ghost type.
Source: I was battling PB and struggle hit Sableye
Stuggle is a move that cannot be learned naturally by any Pokémon. However, every Pokémon can use it, but only if all of their moves
cannot be used, usually due to a lack of PP.The user now takes ¼ of its maximum HP as recoil damage- Bulbapedia
Hope this helps =P