To my knowledge, the Duomo and rooftop in Milan do not sell out very early. My friend and I were in Milan this August. We walked into the ticket office and got tickets after a short wait in line. Hers included the roof, and I think that was timed, but she basically headed over to the appropriate entry point and got in quite quickly. My ticket was just for the church interior, and that didn't have a specified entry time. I'm not suggesting you wait until the day of your visit to buy tickets; we might have been lucky to find a reasonable number of people buying tickets that day. (It was very hot in northern Italy, and a lot of the locals had headed for the mountains or the beach, I'm sure.) However, this is not something you need to worry about very far in advance.
Tickets for The Last Supper sell out instantly when they go on sale. You'll need to set an alarm for the appropriate time in the middle of the night, and you will still need luck. Have all your credit cards (and maybe also all your debit cards) in front of you, because you never know when a ticket website will reject a card. Search this forum for recent posts about getting The Last Supper tickets to learn about the timing. This is one of Europe's toughest-to-acquire tickets.
Online entry tickets for St. Mark's in Venice can be purchased at this webiste: https://basilicasanmarco.skiperformance.com/en/store#/en/buy?skugroup_id=2524. I did not purchase in advance, so I stood in a long line in 2022 which, surprisingly, got me in the door in about 30 minutes. The online tickets definitely sell out more than a few days ahead of time, but I'm not sure how early you need to buy. You can monitor the situation on the linked website to see how availability looks for the weeks leading up to your visit. It's pretty typical for morning tickets for early (but not insanely early) entry times to sell out first at sightseeing attractions. But in this case you might not want the early tickets; I think it's around 11:30 AM when they turn on the lighting that makes the mosaics really sparkle. The place is spectacular even at other times, however. The museum add-on is highly recommended, and you may also want to see the Pala d'Oro.
The Secret Itineraries Tour at the Doge's Palace is popular and sells out in advance. If you're not interested in that, I suspect you don't have to buy a ticket for the Palace very early. I'd make incomplete purchase transactions for a week or two before the date of your visit to monitor how ticket sales seem to be going. I'm not sure when you need to start doing that--maybe a couple of months ahead of time? This is the ticketing website for the Doge's Palace: Palazzo Ducale tickets.
Sightseeing tickets are seldom changeable or refundable, so my preference is not to buy them until I need to. Others may be able to tell you about the timing they employed, but be aware that there will probably be more people in Venice next year (Holy Year, plus traffic there seems in be increasing annually), so you may want to be more conservative in your approach than what others suggest based on their experiences, if they are not extremely recent.