Even if it is, no Diancie is nicknamable because they were all solely event, so the no name alone is most assuredly a hack, but even more than that, no event pokemon can be traded on the GTS or Wonder Trade (not sure when the original poster said they got it from a passerby if they meant from an actual passerby or from wonder trade/gts) so if you got it like that, then that's even double confirmation it's a hack, but if you got it from an actual passerby/acquaintance or friend on your list, then that is totally possible no problem but the no name thing is definitely a hack.
And as for ruining your game, hacks you get from other people don't do anything to your game, so you're safe there. The hacks are self contained to the pokemon and even then if the pokemon has any quality about it that are not legitimate (such as a move it can't actually learn) trading over the internet actually hack checks the pokemon and won't allow it to be traded (tried to trade with someone to get a Pansear with Fire Pledge, trading wouldn't allow it to happen) so any pokemon you get traded to you is technically possible as long as it was traded over the internet. (person to person directly connecting the 3ds without internet assistance maybe not) so any pokemon you have is only affecting itself and won't harm any other pokemon. The only time you need to worry about a hack ruining your game is if you're actively using a cheat device on your game, then anything could happen, but getting the spoils from someone else hacking their game isn't going to harm yours.
And on a side note, before someone brings it up, while technically a no name event pokemon is not possible, it still follows the same rule as all other pokemon, meaning that it has a Trainer name, a Trainer ID and a Secret Trainer ID in it's coding, so it it were ever to be traded to a game that happened to have the correct Trainer Name, Trainer ID and Secret Trainer ID then it would absolutely be nicknameable as it would be governed by the same rules every other pokemon is under, so the hackcheck would not block a nicknamed event pokemon because it is still technically possible to nickname that pokemon.