I've literally not heard of any ocean liners before or after that sunk via iceberg BESIDES Titanic. Sounded like unnecessary hubris to me. Were there ships sinking fairly commonly at that time?
Significantly edited.
I delved into the question in the title a while back, which more or less comes down to two primary factors. The first is what I think of as a passive allowance of a popular belief in the infallibility of the ships. The words "practically unsinkable" were used in relation to the ships in advertisements not done by Harland and Wolff or the White Star Line, but I fiercely doubt "practically" was in the minds of the general public nor was the source. Neither the builders or owners made any effort to quell such notions and Captain Smith himself once proclaimed all modern ships were beyond the possibility of tragedy 5 years before he died on Titanic. She was not the only ship "advertised" as such either, one other example ironically being Lusitania.
The second is an apparent validation of the practice of compartmentalization being sufficient during an incident at sea. The White Star Line themselves suffered 3 such incidents leading up to 1912 that seemed to show they were right in thinking their ships would survive the conditions typically experienced by accidents involving large ships. That being either a grounding or ship-to-ship collision. The former would affect the bottom, which WSL ships (mostly) had 2 separate bottoms and the latter would affect only 2 or 3 compartments. The Suevic in ran aground in 1907 and attempts to rescue her shoved her bow further onto the rocks. They decided to rescue the stern and machinery by blowing her in half, using the internal watertight bulkhead effectively as the hull and towing her to Southampton where she awaited a new bow to be brought in from Belfast.
The RMS Republic suffered a ship-to-ship collision and took 38 hours to sink in 1909. What really cemented the confidence in the sturdiness of the Olympic Class was an accident with its namesake.
In late September 1911, within 7 months of Titanic's maiden voyage, Olympic collided with the Hawke. Hawke penetrated into her stern, flooded 2 compartments with Olympic sustaining damage from D-Deck to the starboard propeller shaft. That didn't matter too much as she not only survived, but sailed from Southampton to Belfast under her own power with only minor patchwork (which failed en route) where she was repaired and put back into service by early November.
If I may ask you a question in return, how many ocean liners have you heard of? I'm not being snide, very few ships are popularly known apart from Queen Mary, Lusitania and Titanic outside enthusiast circles. I have many blind spots myself I want to be rid of, particularly with German liners. I know of a website called wrecksite.eu which currently has 145,540 listed shipwrecks worldwide. When I typed "iceberg" into the search text function, I got 8 pages. I'd have to examine each one (some of which aren't in English) to tell how many sank due to an iceberg or merely encountered one, but Titanic is definitely not the only ocean liner that sank due to an iceberg. If you accept the most popular (and in my view likely) reason for the loss of Naronic, Titanic wasn't even the only White Star Liner sunk by an iceberg.
Going through the list on wrecksite.eu, there is a recurring problem with knowing exactly what happened with some of the ships that sank in iceberg-laden areas. There were no survivors and no equipment to send out distress signals. I also noticed most of the casualties on the list I provided were cargo or fishing vessels or other smaller craft.
That being said, here's the SS Vicksberg. It's the only other ocean liner I can see on this list that was sunk due to an iceberg, though I am aware it's far from the only one that struck one. One possible reason I can think of the numbers being relatively small is ocean liners came to prominence for about 120 years (1840-1960), which isn't that long in terms of naval history. Also, the International Ice Patrol was set up in 1914 as a result of the Titanic disaster, which may have helped ocean liners in being aware of the ice.
Here are a few passenger ships from that list. SS Islander, SV John Rutledge, MV Explorer in 2007, MV Hans Hedtoft, and SS Pera.
On a funnier note, there's a ship called Iceberg that was lost to a fire.
The Titanic was not really touted as unsinkable! Or, at least, this wasn't the major selling point that it's presented as today.
Immediately after the sinking, the Titanic mythos began to develop, as I discussed in this recent answer. The idea that "Nearer My God To Thee" was playing as it sank, for instance, isn't true, but became indelibly attached to the event. There are also aspects of the mythos that are not necessarily myths, but are part of what comes to mind when you think of the Titanic's sinking, the narrative that everyone knows and is included in every work of fiction related to it: women and children first, or steerage passengers being locked below decks. The engineers and builders being arrogant and hubristic, calling the ship "unsinkable", is part of this mythos.
At the beginning of the extended flashback in the film Titanic, Rose's mother says, "So this is the ship they say is unsinkable," as though the public discourse is abuzz on the topic. The 1955 book A Night to Remember set the idea that everyone smugly considered it unsinkable, and publications of the following decades would popularize lines like "God himself could not sink this ship!" and the belief that it was "safer than a lifeboat". All of this gives the impression that ships were constantly sinking and transportation companies and potential passengers were desperate for relief - which was not the case. On the other hand, a rival view (we could call it a second-option bias) appeared in the 1980s that said nobody had ever called Titanic "unsinkable" until after it sank; fewer people heard of this, but it became the insider view for a time.
As stated in the earlier answer, the idea did come up before the sinking - around the time that Titanic and its sister ship, Olympic, were built, both ships' unsinkability was mentioned. There's a 1910 promotional leaflet made by the White Star Line with pictures of both being built, which stated that "as far as it is possible to do so, these two wonderful vessels are designed to be unsinkable". There's also a much nicer brochure from 1911, when the ships were closer to being finished, which touted the safety features:
Each door is held in the open position by a suitable friction clutch, which can be instantly released by means of a powerful electric magnet controlled from the Captain’s bridge, so that, in the event of an accident, or at any time when it may be considered advisable, the Captain can, by simply moving an electric switch, instantly close the doors throughout, practically making the vessel unsinkable.
The last place it was described as "unsinkable" is an issue of the trade magazine, The Shipbuilder, in 1911. This article copied the promotional text above almost word-for-word, changing the end to "make the vessel practically unsinkable".
The thing is, none of these texts were widely read. The pamphlets printed by the White Star Line were only two out of many; the first one only has one copy existing now, so it was probably in very limited circulation, too. The Shipbuilder was expensive, and only of interest to engineers rather than the general public. And all three hedge this claim of unsinkability, using it in slight hyperbole and as a statement of intent rather than a serious claim that Titanic and Olympic could never sink.
Where the "unsinkable" claim entered the mythos is in the days after the sinking. What seems most likely to have happened is that newspaper offices had kept pieces of promotional material filed for use in researching future stories, and a few journalists pulled out clippings that included one or both of these pamphlets. Philip Gibbs's "The Deathless Story of the Titanic" was published soon after the sinking, and attributes the idea of the watertight doors and compartments "practically making the vessel unsinkable" (note the similarity in the phrasing) to an official description, as did the Daily Graphic's special memorial issue, published five days after the event. Another cause is that the VP of the White Star Line, Philip Franklin, stated the morning after the sinking - when the details were still not fully known and rumors were flying about, some even claiming that the ship had been towed to Halifax - "We place absolute confidence in the Titanic. We believe that the boat is unsinkable." Where the earlier material might have been stuffed in the back of a drawer or a filing cabinet, this was said to the public, and very quickly it was multiplied into a widespread belief by the Line's leaders, the passengers, the engineers, and the world that the ship could not possibly sink because of its state-of-the-art technology. A narrative of overweening pride that was smashed by the deaths of more than a thousand innocents appeared almost overnight, helping to make meaning out of the enormous tragedy and make it feel deserved.
For further reading, I would suggest The Myth of the Titanic, by Richard Howells (1999).