In Firefox, can I write a piece of JavaScript code (and assign it to a bookmark) to change an about:config parameter?
No, you cannot. Bookmarklets run with the privileges of the web page you're viewing when you click the bookmarklet, and web pages can't change user preferences...