You should, yes, as long as the other conditions are met - if you happen to be a multiclass paladin/arcane trickster rogue, for example, you should be able to cast green flame blade at an opponent your ally is fighting, and when you hit with the weapon attack roll using your dagger as part of the spell, apply your sneak attack and pump a divine smite into it as well.