John Quincy Adams is widely reported as being the first president to wear trousers to his inauguration. This broke the previous tradition of wearing breeches.
As to ties, it depends on whether you consider a cravat to be a tie.
The suit style popular in western business dress, worn with a tie fastened into a Windsor knot, became popular in the early 20th century. Though the coats were a bit longer and they did not have vents until a few decades later. I'd say Theodore Roosevelt would look somewhat the part in a modern corporate setting. His predecessor McKinley, not so much.