The killings took place before voting started to elect a new assembly with powers to rewrite the constitution.
The opposition says it is a power grab by President Nicolás Maduro and is boycotting the vote.
The government says the constituent assembly is the only way to bring peace back to the country after months of violent protests.
José Felix Pineda, a 39-year-old lawyer running in the election, was shot in his home on Saturday night local time, a senior Venezuelan minister said.
Ricardo Campos, a youth secretary with the opposition Acción Democrática party, was shot dead during a protest, the head of the national assembly said.
Venezuelan newspaper El Universal said two other men were also killed in protests.
On the eve of the vote, protesters blocked roads in the capital in defiance of a ban on demonstrations.
The security forces have used armoured vehicles to dispel protesters in the Caracas district of El Paraíso amid the sound of gunfire, AFP says, citing local reports.
Mr Maduro cast his own ballot shortly after polling stations opened at 06:00 (11:00 BST).
In a speech broadcast on TV, the president predicted a “big victory”, calling the vote “the most important election held in Venezuela’s political system”.
However, electoral council chief Tibisay Lucena acknowledged that some voting machines had been attacked and burned in parts of the country.