I want to know if i write a Google Chrome extension, will anyone be able to use my code?
Since Chrome Extensions are written in JavaScript, and everyone can open the Inspector and see the resources for every extension then, yes, everyone can see the source of your extension. This doesn't mean they'll be able to use it. If you obfuscate the code or use similar techniques to make the code less readable then you can avoid that others look into how your extension works. But as said, they can still use the Inspector to analyze the extension.
If you must hide the secret algorithm in your extension, then you could use a server back-end to handle the secret stuff, completely avoiding anyone can look at your code.