Yes.
Your body doesn’t care where the calories come from. To the second question: it also doesn’t matter. If you don’t workout and just eat in a surplus, the weight gain will just be fat. The source of the calories don’t matter.
Yes, In fact you could reach your protein, fiber, and micronutrient target while being in deficit if you keep added sugars to 10% or less. Theoretically you can lose fat taking in much more sugar than that but obviously you’re gonna run into issues not getting the things above I mentioned
If you want an occasional sugar reward (e.g. candybar) as a snack it is probably not a problem - but note that it takes a LOT of exercise to process an added 250 KCal (\~1 hr of a brisk walk, give or take) just to break even.