Triangles are a frequent background element the creators add to the show to give it a graphic and thematic feel, harkening back to the geometric shapes that Tex Avery used in his cartoons. Some of the background objects have included buildings, grass and water.
Both Phineas and Dr. Doofenshmirtz have triangle shaped heads, though different types. Also, when asked which style he preferred on his shirt, Major Monogram responded "Triangles". Many of the other main characters are based on other geometric shapes (Ferb and Perry as rectangles, Candace and Jeremy as the letter P, etc.).
It's not uncommon to find rectangles on surfaces near where triangles are found. Both of these are most common during Phineas and Ferb's Big Ideas, or in their home.