If it is actually pure tramadol powder and of course you use sterile water, and you micron filter it, then it will be safe. Make sure to micron filter it if you plan to IM. Personally i wouldn't IM it without micron filtering, although you would probably be okay, you really want to make sure there is no particles in the solution if you're injecting it into a muscle.
Unless you have a specific reason(longer duration, slower onset, ect.) to use the solution IM, you could use it IV. In any case i would definitely suggest you micron filter your solution.