There are badges which you earn when you have voted/edited
x number of times in a day or overall.
Do these votes/edits count even if the question was closed afterwards? And do only the votes/edits count which I make or which also those I get?
Yes, they count. Users simply can't add something to the discussion.
The only things that doesn't count is the deleted posts (questions and answers).