First you have to put the kitten is a secure location when you aren’t around, such as a large dog crate, a bathroom, a box in a spare bedroom, etc. You want to make sure it stays warm and out of trouble. At 3 1/2 weeks it’s just starting to eat solid food. Get kitten milk replacer and put it in a small saucer or dish and see if it’ll lick it up. Otherwise, you need to get a bottle to bottle feed it. Because their stomachs are small, you need to feed it 3-4 times a day. For best results, make the kitten milk slightly warm, but not hot. Now after that, you need to use a warm wet paper towel to stimulate it to poop and pee. Usually just a few wipes will do. Check videos online. Or it may do it on it’s own. Usually they have to eliminate right after feeding so put lots of newspaper, papertowels or old clothes towels in the box in case he goes in there. If he’s mother was still around, she would lick his behind to get him to pee and poop and eat the contents.
If a week or so, he should be ready for litter training. You just have to get a short litter box or even use a disosple cake pan. Fill it with a little bit of unclumping litter, shredded paper, or mulch like for bunnies. Then you just gotta put them in their after meals and do a digging motion with the kitten’s paws. Also, put “accidents” in the litterbox. Once they associate the litterbox with going to the bathroom, they will get it and be trained. It’s MUCH easier than house training a dog.
As far as the dog, you can see how the dog will react to the kitten, but I WOULD NOT leave the dog unattended with the kitten. Especially if they are a terrier or have a high prey drive. Sometimes dogs will take on a “mothering” role with the kitten and groom it, stimulate it to poop, keep it warm, etc. see what their interactions are like. If they will take on the Substitute mommy role, then that’s less work for you!
Make sure you dog isn’t neglected and get’s lots of attention, treats, playtime,etc. Maybe even a little more than usual. If the dog’s schedule doesn’t change, then he should be fine with the kitten.