Yes you can eat the green part of shallots if you want too.
All parts of shallots are edible whether raw or cooked but they are usually much better eaten cooked.
But your personal tastes can differ from mine and others.
The leaves and the flowers of shallots can also be eaten and are good is salads.
Both the green and white parts of shallots are edible and can be eaten raw or cooked and the green part of the shallots has a milder flavor and makes an attractive garnish while the white part of the shallots are more sharper tasting, or more onion-y.