The way you worded this question is really difficult to answer. What exactly do you mean "basis of society?" That could mean anything from general ethical codes to mandatory religious beliefs.
But to answer your question, no, a single religion being endorsed by a democracy is not contrary to the idea of democracy. Today we largely equate democracy with personal freedom, but it's important to remember they are actually not linked. After all, when the United States was founded, only white men who owned property could vote, but that doesn't mean the USA wasn't a democracy back then. With that in mind, a hypothetical democracy based on a specific religion could certainly limit it's voters to only believers of that religion.
Some Democratic Nations aren't based on religion period. Such as the United States of America.