Is it practically possible to do research and work?
Yes it is. In fact, once I met one amazing girl that was working as a software engineer, getting a Master Degree in AI and getting a bachelor degree in Fine Arts at the same time. However, as the proverb says, the more you hold, the less you squeeze (does that even make sense in english?). She had to do all of these things half time, and of course that means less money from the job, and more time to finish the degrees. Also it requires an incredible amount of willpower and basically all your free time, so is up to you.
However, there are two more reasonable alternatives here.
The first one, less likely, is to actually get your Ph.D. in a private company. It is rare, but not impossible. I met one guy that was getting is Ph.D. in computer science in a private company. If you are that lucky, you can work and get a Ph.D. at the same time.
The second one is to get your Ph.D. in a university, but getting involved in a research project. Some so called "researchers" in university actually do as much development work as any folk in a private company. That was actually my case. My Ph.D. involved some research, but also a good deal of development. I had to create this application from scratch and deal with the whole development cycle by myself. After I was done with that, they assigned me as a developer in a different project.
The bad thing on this case is that, although you are actually doing development work, most companies don't count your time in university as "working experience". But you will get the experience nevertheless.
Is it a good idea to work for a year or two after my masters, and
start a PhD after that?
It is possible? Definitely. Advisable? not so sure.
One of my friends was exactly in that situation. She worked for several years after her master, and then started a Ph.D. pretty late (on her late 20s).
Her experience was fine because she managed to get her Ph.D. But it didn't came without obstacles.
To begin with, it is rare to find older people doing a Ph.D. Depending on who works with you, they may ask questions, and sometimes it can be unpleasant. But I wouldn't say this is a big issue.
More important is "getting out of touch" with research. Academia is like a bubble of its own outside the "real world" of companies. When you finish you Master degree you are "on fire" and on your prime to tackle a Ph.D. If you go to work for a few years, you may "cool off" and it can be harder to pick up.
On the flip side, working in a company may give you very valuable skills to deal with the Ph.D. And I'm not talking about technical skills, but about soft skills such as time management or dealing with people.
What kind of internships can I do, and how long should they be, so I
can apply to IT companies?
Sorry but I have no idea and I can't help you here. You should ask your university as they will be able to fill you in with all your available options.
My only advice from personal experience is that having a Ph.D. can be a big plus when looking for a job, even with no previous experience.