When selling a game with a bonus code still in date, can this code be used by the person who buys it if I've used the code myself
No. The bonus codes are only redeemable once.
Infact, these codes are often supplied as a bonus for the first-hand buyer. The idea would be that the user purchasing the game second hand would not be able to reuse the code, and would then purchase the content from the relevant online store, if they wished to play it. In turn,developers would at least see some profit out of the particular user, where as they do not recieve any profits when a game is sold second hand. There was actually talks of making this unique code a requirement to play, so second hand games would still require the user to 'pay tithe'. Some games employed a similar mechanic on the online component, where the bonus code would be a requirement to play online.
Almost every form of redemption code, in regards to video games, comes with an express one-time use.
Consider if this was not the case; DLC codes would sweep across the internet almost as soon as it was released, and users would be able to reuse the same key, effectivley allowing everybody to play without actually paying for the content. In turn, the developers would realise they were not making money, which makes a big impact on wether they make the game/DLC, in the first place.