AYou can use magic staff as a quarterstaff
It is explicitly stated in the Dungeon Master's Guide, page 140:
Unless a staff's description says otherwise, a staff can be used as a quarterstaff.
However a rod is not a staff
DMG page 139 says that a magic rod
is typically made of metal, wood, or bone. It's about 2 or 3 feet long, 1 inch thick, and 2 to 5 pounds.
So it is probably one-handed, resembling a club or a baton. A quarterstaff is a two-handed weapon with a length of 6-9 ft. A rod is probably one-handed, resembling a club or a baton, 2-3 ft. long.
You still can fight with it though
However, itIt can be more than just an "improvised weapon". A rod can be treated as a club, seeas it stated in the Player's Handbook, page 147:
In many cases, an improvised weapon is similar to an actual weapon and can be treated as such. For example, a table leg is akin to a club.