Writing code for new microcontroller/module without examples
I started learning embedded systems programming(after a long time when
I stopped) and I see that most microcontroller boards/modules come
with some set of example codes which can be used a base to create new
projects.

The range of skills possessed by an audience for microcontroller programming is quite wide, these days. (The range was much smaller and had much higher requirements 30-40 years ago.)
You can look at this as a pyramid, of sorts. At the top of the pyramid you have experimental physicists, who possess a wide gamut of knowledge that includes profound mathematical, numerical, and complex analysis skills along with signal processing, operating system design and implementation, assembler, linker, and compiler design and coding, etc. These folks can literally fabricate a computer from the ground up. There aren't many of them. But they are highly skilled. At the bottom of the pyramid, with a much broader and larger base, you find people with the ability to code in higher level languages (or Excel) and pretty much little else. They can cobble up a UI program or an application running on Android using existing library stacks. But they could not design a practical sine function algorithm even if their life depended on it. They can use tools others have developed. But they would be hard-put to write anything novel on their own.
Sample/example code exists to address people more towards the bottom of the above pyramid. Those who need a basic model they can modify readily to achieve modest results on their own.

my goal is to get job in embedded systems programming and I would like
to know, do developers in the industry also use examples code as base
? If not, what is the industry practice?

All this depends on your own interests and life goals. Is programming &quot;just a job to you?&quot; A nine-to-five kind of thing that when you go home you completely forget about and go watch TV or mow the lawn? If so, you'll want a stable job with a company that can provide clear goals and only expects fixed hours from you and reasonable output from you given some salary they pay for it.
I tend to imagine, though, that embedded programmers generally are already above the bottom of the pyramid and are the kind of people who push themselves for more and work hard to reach towards higher levels. These people will want to understand how a compiler and a linker interact, for example, in some significant level of detail. They are the kinds of people who like the idea of actually writing their own operating system. Perhaps even trying their hand at a compiler and/or linker tool, too. And someone who wants to understand more about computer architecture and design. Maybe even try their hand at coding an MCU using VHDL or Verilog using an FPGA, just to see if they can do it.

All that said, the reality is that what counts as &quot;embedded&quot; depends on the application space.
If you need WiFi capability and need to support USB, you probably will want to use libraries that already provide these features for you and won't want to code them, yourself. (Thousands of pages of reading difficult text is a bit &quot;much&quot; if all you need to do is &quot;get something done, quickly.&quot;) An ESP8266 or ESP32 is probably all you need here and you'd be more focused on just getting an application done. (No assembly required.) Here, example code can be very helpful.
If you need to achieve something that competes well on battery longevity, size, cost, volume, power, operation over wide temperature ranges, precision, calibrated accuracy, and many other complicated specification boundaries, then you will need a higher level of detailed understanding and will be using fewer libraries (perhaps none, at all) and will need the skills to develop almost all of the algorithms. In this case, example code will have almost no utility at all. All it will do for you is provide a quick way to make sure that you've installed all the necessary development tools, correctly, and that you can prove that you've got the basics in place.

So, decide who you want to be in the long term and what kind of goals you have in life. You can do very, very well for yourself without needing to learn much more than how to use existing libraries and leverage your coding upon the extensive work of others who have created the basic libraries you need. You can also do equally well for yourself if you pursue a greater level of detailed knowledge. I don't think one approach is better than another. And both are equally able to provide a good future.
The main difference is your competition. If you are looking at embedded applications that rely more on existing library systems and familiarity with common MCUs, such as the ESP32 for example, then you will be competing with many more people. If you focus on far more detailed knowledge, then your competition is smaller. But I don't think either of these provide significant differences in pay scale or levels of stress in getting the job done.
So just look at your own desires and decide who you are now and who you want to be, later. Then go for it.
There is no bright line approach, though. You choose who you are to become and then pursue that goal. You let the rest flow out of that decision.