Most European and Scandinavian countries have submarines. After the big 3 countries I think the French and maybe China are the only ones to have nuclear submarines. India, Iran and a few South American navies have small numbers of subs.
Wikipedia (maybe not the most accurate) has the Russians with 37 nuclears (+5 being built), 20 conventional (+2), and 7 "auxiliary" vessels.
I very much doubt that these are all safe/seaworthy.
An interesting site is :
Narciso Monturiol launched his "Ictineo" 28 June 1859.
Isaac Peral launched 8 September 1888 a submarine which is considered the first practical submarine vessel planned as an underwater weapon.
Submarines of the spanish navy at present:
4 S-60 Daphne class
4 S-70 Agosta class
Plus 6 S-80 Scorpene class under construction or project.