Whether you can run Team Fortress 2 on a laptop depends on whether the machine meets the game's minimum requirements. Many modern laptops, especially those with dedicated graphics, handle it just fine, while older or budget models may struggle.
The best way to know for sure is to compare your laptop's specs against the official system requirements. You can find a helpful community guide to those requirements here: https://forums.steampowered.com/forums/showthread.php?t=2234063
Check your processor, RAM, and graphics against the listed minimums, and you will have your answer.