To my knowledge, this belief has only been getting pushed in the last handful of years. The thought is that you can only worship gods if you are from the same ethnic background. For example, some believe that it would be wrong for a Spanish person to worship Egyptian gods, or for a Russian to worship the Greek pantheon.
This seems to have arisen recently as a result of all the “cultural appropriation” that’s going around. Suddenly people are getting very upset if you’re using something from an ethnicity that you don’t have blood ties to. In the past, Pagans have been hugely understanding, realizing a few important points: 1) Hardly anyone on earth is pure blood anymore, if anyone at all, so we all have mixed ethnic backgrounds and you can’t say for certain that someone doesn’t have a connection. 2) You cannot control what higher powers may choose to communicate with you. Denying them because they’re not like you would be rude to say the very least.
While it is important to respect the origins of whatever deities you follow, most will tell you that there’s nothing wrong with following a god or gods that differ from you ethnically. It would be very important for you to learn all you can about the culture though, and to take measure to avoid offending people who do have an ethnic connection. (Usually that’s a simple as keeping your business to yourself.)
Pagans as a whole worship a huge number of deities and entities, and they’re not always genetically connected to their place of origin. There’s no law that says you can only worship based on what’s in your blood. If a path is right for you, you’ll know, and you shouldn’t let anyone deter you from following it.
*Disclaimer: I no longer practice Paganism, but I’ve left these Pagan Myths articles active because I believe they’re still valuable in helping people to understand Paganism and reduce negative stereotypes.*