I am an absolute beginner to the theory of music and was just curious if there are instruments around the world which break this 'rule' of 12 notes. I know it is possible but are there any such instruments which are popular in any parts of the world.
First of there is no "rule of 12 notes". We use 12 notes largely due to how we've historically
built and tuned our instruments in a manner where this works.
You have one instrument on you right now that can split the octave into an infinite set of notes which is your voice as can most of the string family. If you are really curious you can look up microtonal music which uses intervals smaller than a semitone in composing music, which in comparison to the smallest unit in the 12 tone ET system is a semitone.
The notion of an octave is fairly universal, and there are a lot of psychophysical explanations for this.
But many musical cultures approach division of the octave and scalar theory very differently from the West. One example is Indian classical music, which uses just-intonation as opposed to equal-temperament, so that there are 12 notes in an octave but they're not quite the same as on a piano (note that the frequency ratio of any two piano notes is irrational unless the notes are in the same pitch class!) But in a just-intoned system, which focuses on purity of certain intervals (so that their frequency ratio is a simple rational number), it's not possible to play an evenly spaced chromatic scale. So in choosing a discrete tuning system you constrain yourself in various ways, and it's important to weight musical priorities.
Sometimes, however, precise intervallic relations are not important at all! Melodic contour and rhythm are far more important to some musics, with precise pitch being much less of concern. Particularly for some mono/homophonic or percussive-centric traditions.
One example is Indonesian Gamelan, which tends to use two types of tuning. One is sort of similar to the Western diatonic scale, and the other to the pentatonic, but neither is near equivalent, or even self-consistent. In fact, tuning plays an altogether different role in Gamelan (especially for metallophones like the gangsa). Instruments are not even 'in tune' with each other, in the conventional sense of 'in tune.' Rather pairs of instruments are intentionally slightly 'out of tune' in order to generate acoustical phenomenon like beating. For example:
Not only are there instruments that split the octave not into 12 equal-sized steps but some irregular division, and plenty of instruments that don't have any particular steps at all.
There are also systems that have a fixed, mathematical step size but it's not 12√2. I consider it remarkable enough that western harmony (which is essentially spanned by Pythagorean modulations of a Ptolemaic scale model – both just intonation, based on 3:2 and 5:4 frequency ratios) can so well be approximated by as little as 12 steps. But you can't say it's approximated anywhere near perfect: the major thirds are actually quite notably too big. Furthermore, why use only two just-intervals as the basis? the 7:4 interval sounds pretty amazing; it features prominently in Barbershop singing, but can only very unsatisfyingly be approximated in 12-edo.
Both of these problems can be fixed if you go to finer octave divisions such as 22-edo and 31-edo. The latter was actually put forward by Huygens before 12-edo ever took hold in Europe, but unfortunaly hasn't took hold except in a few organs. 22-edo and others are getting some interest by experimentally-inclined guitarists these days. Ron Sword is the most prolific maker of such guitars (that I'm aware of).
There are even fixed-step tuning systems that have nothing to do with octaves at all. The best known of these is the Bohlen-Pierce tuning (13-edt, i.e. steps of 13√3). Others include the α- β- and γ-tunings, as Wendy Carlos calls them. These tunings pick out some other just-intonation interval, not the octave, and divide it into a number of steps suitable for approximating other intervals. On these instruments, it is not possible to play an octave, though! 13-edt is thus particularly interesting for instruments which don't have octaves naturally in their overtone series, notably clarinets.
First you need to ask "are there musical scales that are not based on 12 intervals in an octave?" to which the answer is "yes, many of them", in Western music as well as around the world. This Wikipedia article lists several (ahving from 1 to 8 intervals per octave, 7 actually being the common '12 note' scale), and would be a great read for understanding the topic of scales and intervals. Note that using only specific notes from the standard Western scale (e.g. minor keys) is different from actually having different intervals.
To rephrase your question then, "are there instruments designed around these alternate scales?" Again, "yes". Many of the other examples already given actually list instruments that are based on a 12-note scale, but can play non-discrete notes, e.g. string instruments where finger placement can be infinitely adjusted, or wind instruments where the musician can "bend" the pitch up or down.
Most non-fretted (e.g. a guitar) stringed instruments could be tuned to an arbitrary scale. For instruments with discrete notes, the tuning is built in. I assume an extensive listing of cultural instruments is beyond the scope of this question, but a Google image searches for, say, pentatonic instruments shows drums, struck or plucked keyboard arrangements, horns, flutes, drums, and of course a wide variety of stringed instruments in many shapes and sizes.
The swanee whistle plays all the notes 'in the cracks'. All stringed instruments (the violin family) can play other notes than the 12. Guitars commonly bend notes, although they're fretted to produce the 12. Sitars play other notes as well, along with probably a lot of other instruments from India/Asia.
Since drums and other percussion are instruments, I'm not sure how they would qualify within those parameters.
This question has many answers, probably too many to fit here.
There is such thing as microtonal music. If you want to gel a general idea, you can check Wikipedia for this.
Instrument-wise, many eastern-music instruments are designed to play makams (which are scales that are played in eastern music that occupies comma notes). So yes, there are instruments that do not split an octave to 12 semitones.
I studied under some pretty great professors at U. of California campuses (back in the day!) when I was taking Electronic & Computer Music classes. The preliminary classes go over all the various approaches to scales and intonation that history has given us. Given that we're all using computers these days, I'd suggest using one as your "instrument" and coming up with your own scale(s). Composers have lots of options to merge programming with sound these days (for good or ill-- i.e. it's been disgusting to see repetitive beat machines and "pitch correction" make pop music into unlistenable dreck!) but I recommend the academics' standard, going way back.. which is now very well along in its development and maintenance. Csound: https://csound.github.io/